{"raw_statement":[{"iden":"problem statement","content":"You are given integers $N$ and $K$.\nLet's call an integer array $a=[a_1, a_2, \\ldots, a_K]$ of length $K$ **good**, if $1 \\le a_i \\le i$ for all $1 \\le i \\le K$.\nLet's call an integer array $b=[b_1, b_2, \\ldots, b_{NK}]$ of length $NK$ **amazing**, if it can be split into $N$ (not necessarily contiguous) subsequences of length $K$, each of which is good.\nLet's define $f(pos, val)$ as the number of amazing sequences $b$ such that $b_{pos}=val$.\nFind $f(pos, val)$ for all $1\\le pos \\le NK$, $1 \\le val \\le K$. As these numbers can be very big, output them modulo some prime $P$."},{"iden":"constraints","content":"*   $1 \\le N \\le 20$.\n*   $1 \\le K \\le 20$.\n*   $10^8 \\le P \\le 10^9$\n*   $P$ is a prime."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$ $P$"},{"iden":"sample input 1","content":"2 2 965166677"},{"iden":"sample output 1","content":"6 0 \n4 2 \n4 2 \n3 3 \n\nThere exist $6$ amazing arrays:\n\n*   $[1, 1, 1, 1]$ ー can be split into $[b_1, b_2], [b_3, b_4]$.\n*   $[1, 1, 1, 2]$ ー can be split into $[b_1, b_2], [b_3, b_4]$.\n*   $[1, 2, 1, 1]$ ー can be split into $[b_1, b_2], [b_3, b_4]$.\n*   $[1, 2, 1, 2]$ ー can be split into $[b_1, b_2], [b_3, b_4]$.\n*   $[1, 1, 2, 1]$ ー can be split into $[b_1, b_3], [b_2, b_4]$.\n*   $[1, 1, 2, 2]$ ー can be split into $[b_1, b_3], [b_2, b_4]$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}