Sashka regularly takes part in online programming competitions. The prize for the current one is participation in a summer programming camp in the Maldives. Especially for this contest she has set her username to be Sorting. One of the tasks is the following:
The jury has come up with a permutation p_1,p_2,p_3,…,p_N of the numbers from 1 to N. The task is to find the permutation and in order to do so you can ask the jury the following two types of questions:
You have to ask as few questions as possible from the first type (see the scoring section below), but the number of questions of the second type is unlimited.
Help Sashka by writing a program sorting, which by given N restores the permutation. It must contain the function solve, which will be compiled and executed with a jury’s program.