{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" Given a positive integer \u003ci\u003en\u003c/i\u003e and a positive prime number \u003ci\u003ep\u003c/i\u003e, find \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e and \u003ci\u003ez\u003c/i\u003e such that \u003ci\u003ex\u003c/i\u003e\u003csup\u003e\u003ci\u003en\u003c/i\u003e\u003c/sup\u003e+\u003ci\u003ey\u003c/i\u003e\u003csup\u003e\u003ci\u003en\u003c/i\u003e\u003c/sup\u003e\u003dz\u003csup\u003e\u003ci\u003en\u003c/i\u003e\u003c/sup\u003e modulo \u003ci\u003ep\u003c/i\u003e and \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e and \u003ci\u003ez\u003c/i\u003e are nonzero modulo \u003ci\u003ep\u003c/i\u003e or report that there\u0027s no such triple.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of the input file contains the number \u003ci\u003et\u003c/i\u003e of testcases to solve, 1 ≤ \u003ci\u003et\u003c/i\u003e ≤ 1000. Each of the next \u003ci\u003et\u003c/i\u003e lines contains two integers \u003ci\u003en\u003c/i\u003e and \u003ci\u003ep\u003c/i\u003e, 3 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e, 2 ≤ \u003ci\u003ep\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eFor each input testcase, output one line: \u003cul\u003e \u003cli\u003ewhen there exists a solution, output three integers \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e and \u003ci\u003ez\u003c/i\u003e, 1 ≤ \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e, \u003ci\u003ez\u003c/i\u003e ≤ \u003ci\u003ep\u003c/i\u003e-1. If there are multiple solutions, output any. \u003c/li\u003e\u003cli\u003ewhen there\u0027s no solution, output one integer -1. \u003c/li\u003e\u003c/ul\u003e\u003cbr\u003e"}},{"title":"Sample 1","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\u003e2\n5 41\n3 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\n1 2 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}