{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\n We say that integer x, 0 \u0026lt; x \u0026lt; n, is a primitive root modulo n if and only if the minimum positive integer y which makes x\u003csup\u003ey\u003c/sup\u003e \u003d 1 (mod n) true is φ(n) .Here φ(n) is an arithmetic function that counts the totatives of n, that is, the positive integers less than or equal to n that are relatively prime to n. Write a program which given any positive integer n( 2 \u0026lt;\u003d n \u0026lt; 1000000) outputs all primitive roots of n in ascending order.\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"Multi test cases.\u003cbr\u003eEach line of the input contains a positive integer n. Input is terminated by the end-of-file seperator."}},{"title":"Output","value":{"format":"HTML","content":"For each n, outputs all primitive roots of n in ascending order in a single line, if there is no primitive root for n just print -1 in a single line."}},{"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\u003e\u003cpre\u003e4\r\n25\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e3\r\n2 3 8 12 13 17 22 23\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}