#abc286f. [abc286_f]Guess The Number 2

[abc286_f]Guess The Number 2

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 11 and 22; phase 11 is immediately followed by phase 22.

(Phase 11)

  • The judge decides an integer NN between 11 and 10910^9 (inclusive), which is hidden.
  • You print an integer MM between 11 and 110110 (inclusive).
  • You also print an integer sequence A=(A1,A2,ldots,AM)A=(A_1,A_2,\\ldots,A_M) of length MM such that 1leqAileqM1 \\leq A_i \\leq M for all i=1,2,ldots,Mi = 1, 2, \\ldots, M.

(Phase 22)

  • The judge gives you an integer sequence B=(B1,B2,ldots,BM)B=(B_1,B_2,\\ldots,B_M) of length MM. Here, Bi=fN(i)B_i = f^N(i). f(i)f(i) is defined by f(i)=Aif(i)=A_i for all integers ii between 11 and MM (inclusive), and fN(i)f^N(i) is the integer resulting from replacing ii with f(i)f(i) NN times.
  • Based on the given BB, you identify the integer NN that the judge has decided, and print NN.

After the procedure above, terminate the program immediately to be judged correct.

Constraints

  • NN is an integer between 11 and 10910^9 (inclusive).

Input and Output

This is an interactive task, where your and the judge's programs interact via Standard Input and Output.

(Phase 11)

  • First, print an integer MM between 11 and 110110 (inclusive). It must be followed by a newline.

MM

  • Then, print a sequence A=(A1,A2,ldots,AM)A=(A_1,A_2,\\ldots,A_M) of length MM consisting of integers between 11 and MM (inclusive), with spaces in between. It must be followed by a newline.

A1A_1 A2A_2 ldots\\ldots AMA_M

(Phase 22)

  • First, an integer sequence B=(B1,B2,ldots,BM)B=(B_1,B_2,\\ldots,B_M) of length MM is given from the input.

B1B_1 B2B_2 ldots\\ldots BMB_M

  • Find the integer NN and print it. It must be followed by a newline.

NN

If you print something illegal, the judge prints -1. In that case, your submission is already considered incorrect. Since the judge program terminates at this point, it is desirable that your program terminates too.

Notes

  • After each output, add a newline and then flush Standard Output. Otherwise, you may get a TLE