{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cbr\u003eLet\u0027s call a\u003cimg src\u003d\"CDN_BASE_URL/0a76756f3cbf264c12bc5d2cf61dd01d?v\u003d1714869982\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003ea non-oriented graph such that each pair of different vertices is connected by exactly one edge, colored in any of \u003ci\u003eM\u003c/i\u003e different colors. Two colored graphs are\u003cimg src\u003d\"CDN_BASE_URL/1fa6a6f45936ed0d27ffca1456588ca6?v\u003d1714869982\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003eif the vertices of the first graph can be renumbered in such a way that it becomes equal to the second graph (i.e. the colors of the edges are the same).\u003cbr\u003eYou are given \u003ci\u003eN\u003c/i\u003e, \u003ci\u003eM\u003c/i\u003e and a prime \u003ci\u003eP\u003c/i\u003e. Your task is to find the number of distinct non-isomorphic graphs having \u003ci\u003eN\u003c/i\u003e vertices. The number should be output modulo \u003ci\u003eP\u003c/i\u003e.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe only line of the input contains three integers \u003ci\u003eN\u003c/i\u003e, \u003ci\u003eM\u003c/i\u003e, \u003ci\u003eP\u003c/i\u003e (1≤ \u003ci\u003eN\u003c/i\u003e≤ 53, 1≤ \u003ci\u003eM\u003c/i\u003e≤ 1000, \u003ci\u003eN\u003c/i\u003e\u003cp\u003e9).\u003cbr\u003e\u003c/p\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eOutput the answer to the problem in the only line of the output.\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\u003e1 1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","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\u003e3 2 97\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 3","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\u003e3 4 97\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e20\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003cbr\u003e\n Novosibirsk SU Contest #2, by Novosibirsk Team #1"}}]}