{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eProfessor Ivanov has told professor Petrov about a new sorting algorithm, \r\nbased on the following function \u003cb\u003echange\u003c/b\u003e.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par_pre\"\u003e\u003cpre\u003echange(a: integer)\r\nbegin\r\n\tfor j :\u003d 0 to n - 1 do\r\n\tbegin\r\n\t\tif p[j] \u003d a then\r\n\t\t\tk :\u003d j\r\n\tend\r\n\tswap(k, (k + p[k]) mod n)\r\nend\u003c/pre\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFunction \u003cb\u003eswap(i,\u0026nbsp;j)\u003c/b\u003e swaps two elements \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e and \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003ej\u003c/i\u003e\u003c/sub\u003e.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eProfessor Ivanov states that any permutation \u003ci\u003ep\u003c/i\u003e\u003csub\u003e0\u003c/sub\u003e, …, \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003en\u003c/i\u003e − 1\u003c/sub\u003e\r\nof integers 1, ..., \u003ci\u003en\u003c/i\u003e can be sorted in ascending order with\r\nseveral calls of function \u003cb\u003echange\u003c/b\u003e. All you need is to find \r\nfor each call of function \u003cb\u003echange\u003c/b\u003e right integer argument \u003ci\u003ea\u003c/i\u003e in \r\nlimits from 1 to \u003ci\u003en\u003c/i\u003e.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eProfessor Petrov trusts to his colleague, but he hasn’t understood the algorithm well.\r\nSo he has suggested a permutation \u003ci\u003ep\u003c/i\u003e\u003csub\u003e0\u003c/sub\u003e, …, \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003en\u003c/i\u003e − 1\u003c/sub\u003e and asked\r\nprofessor Ivanov to sort it in ascending order using function \u003cb\u003echange\u003c/b\u003e.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line of input contains an integer \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 500). \r\nThe second line contains the permutation \u003ci\u003ep\u003c/i\u003e\u003csub\u003e0\u003c/sub\u003e, …, \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003en\u003c/i\u003e − 1\u003c/sub\u003e of integers 1, ..., \u003ci\u003en\u003c/i\u003e, \r\nsuggested by professor Petrov. \u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf professor Ivanov can’t sort the given permutation using function \u003cb\u003echange\u003c/b\u003e,\r\nprint “Impossible”.\r\nOtherwise, on the first line print integer \u003ci\u003em\u003c/i\u003e: the number of calls\r\nto the function (0 ≤ \u003ci\u003em\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\r\nOn the next \u003ci\u003em\u003c/i\u003e lines, output argument \u003ci\u003ea\u003c/i\u003e that should be used\r\nin each call (1 ≤ \u003ci\u003ea\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e).\r\nIt is guaranteed that if it is possible to sort the given permutation,\r\nit can be done in no more than 10\u003csup\u003e6\u003c/sup\u003e function calls.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n1 3 5 2 4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n4\r\n3\r\n3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}