E. Equal Strings
time limit per test
3 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

This is an interactive problem.

$$$n - 1$$$ random binary strings $$$s_i$$$ of length 50 are generated. Then, one of the strings is duplicated, and all $$$n$$$ strings are shuffled. You need to find indexes of equal strings.

You can ask at most $$$25\ 000$$$ queries. Each query is a pair $$$(i, j)$$$. The answer to the query is the Hamming distance between $$$s_i$$$ and $$$s_j$$$ — the number of positions where they differ.

It is guaranteed that all strings are picked randomly from the uniform distribution. Also, the list of strings is fixed for each test — interactor is not adaptive.

Interaction

First, the interactor prints one integer $$$n$$$ ($$$2 \le n \le 1000$$$) — the total number of strings.

Then, you can ask at most $$$25\ 000$$$ queries in the format "i j" ($$$1 \le i, j \le n, i \ne j$$$). Don't forget to flush the output after each query!

For each query, you will receive one integer $$$d$$$ ($$$0 \le d \le 50$$$) — the Hamming distance between $$$s_i$$$ and $$$s_j$$$. After receiving $$$d=0$$$, your program should terminate.

Example
Input
4

21

23

21

0
Output

1 2

2 3

1 4

2 4
Note

Strings in the sample:

  • 10110000010010010101011100011000000011001011000101
  • 10101101000111001111100000010010000100101011100101
  • 10011110110010011111100111011000010100011101111011
  • 10101101000111001111100000010010000100101011100101