#abc282f. [abc282_f]Union of Two Sets
[abc282_f]Union of Two Sets
Problem Statement
This is an interactive task, where your and the judge's programs interact via Standard Input and Output.
You and the judge will follow the procedure below. The procedure consists of phases and ; phase is immediately followed by phase .
(Phase )
- The judge gives you an integer .
- You print an integer between and , inclusive.
- You also print pairs of integers such that for every (the pairs do not have to be distinct).
(Phase )
- The judge gives you an integer .
- You and the judge repeats the following times.
- The judge gives you two integers and as a query.
- You respond with two integers and between and , inclusive (possibly with ). Here, and must satisfy the condition below. Otherwise, your submission will be judged incorrect.
- The union of the set and the set equals the set .
After the procedure above, terminate the program immediately to be judged correct.
Constraints
- All values in the input are integers.
Input and Output
This is an interactive task, where your and the judge's programs interact via Standard Input and Output.
(Phase )
- First, is given from the input.
- Next, an integer between and , inclusive, should be printed.
- Then, should be printed, one at a time. Specifically, for each , the -th output should be in the following format:
(Phase )
- First, is given from the input.
- In each query, integers and representing the query are given in the following format:
- In response to each query, two integers and should be printed in the following format:
Cautions
- At the end of each output, print a newline and flush Standard Output. Otherwise, you may get the TLE