QOJ.ac

QOJ

Time Limit: 2.0 s Memory Limit: 512 MB Total points: 100

#18346. Exactly One Point

Statistics

For two nonnegative integers $a, b$, let $a \wedge b$ be their bitwise AND, and $a \vee b$ be their bitwise OR.

You are given an array $A_0, A_1, \ldots, A_{2^N - 1}$ of length $2^N$ consisting of nonnegative integers. Please find a pair of indices $0 \le i, j \le 2^N - 1$ such that $A_{i} + A_{j} < A_{i \wedge j} + A_{i \vee j}$, or state that no such pair exists. If there is more than one such pair, find any one of them.

Input

The first line contains an integer $N$ ($0 \leq N \leq 20$).

The second line contains $2^N$ integers: $A_0, A_1, \ldots, A_{2^N - 1}$ ($0 \leq A_i \leq 10^7$).

Output

If there is an answer, output two integers $i$ and $j$ denoting the answer. The numbers $i$ and $j$ should be in the range $[0, 2^N - 1]$. Otherwise, output -1.

Examples

Input 1

2
0 1 1 2

Output 1

-1

Input 2

2
0 1 1 3

Output 2

2 1

Input 3

0
100

Output 3

-1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.