{"raw_statement":[{"iden":"problem statement","content":"Find the number of $h \\times w$ binary matrices which satisfy both of the following conditions modulo $M$:\n\n*   When each row is interpreted as a string of length $w$, they are sorted in lexicographical order in the row direction.\n*   When each column is interpreted as a string of length $h$, they are sorted in lexicographical order in the column direction.\n\nGiven integers $H, W$ in the input, find the answer for all pairs of integers $h, w$ that satisfy $1 \\le h \\le H$, $1 \\le w \\le W$."},{"iden":"constraints","content":"*   $1 \\le H \\le 21$\n*   $1 \\le W \\le 100$\n*   $2 \\le M \\le 10^9$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$H \\ W \\ M$"},{"iden":"sample input 1","content":"2 3 5201314"},{"iden":"sample output 1","content":"2 3 4\n3 7 14\n\nFor example, in the case of $(h, w) = (2, 3)$, there are $14$ matrices that satisfy the conditions of the problem statement, as shown below:\n\n000 000 000 000 001 001 001 001 001 011 011 011 011 111\n000 001 011 111 001 010 011 110 111 011 100 101 111 111"},{"iden":"sample input 2","content":"10 8 1000000000"},{"iden":"sample output 2","content":"2 3 4 5 6 7 8 9\n3 7 14 25 41 63 92 129\n4 14 45 130 336 785 1682 3351\n5 25 130 650 2942 11819 42305 136564\n6 41 336 2942 24520 183010 1202234 6979061\n7 63 785 11819 183010 2625117 33345183 371484319\n8 92 1682 42305 1202234 33345183 836488618 470742266\n9 129 3351 136564 6979061 371484319 470742266 230288201\n10 175 6280 402910 36211867 651371519 194085968 670171373\n11 231 11176 1099694 170079565 17940222 26957098 939510047"},{"iden":"sample input 3","content":"5 5 2"},{"iden":"sample output 3","content":"0 1 0 1 0\n1 1 0 1 1\n0 0 1 0 0\n1 1 0 0 0\n0 1 0 0 0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}