{"raw_statement":[{"iden":"problem statement","content":"You are to generate a graph by the following procedure.\n\n*   Choose a simple undirected graph with $N$ unlabeled vertices.\n*   Write a positive integer at most $K$ in each vertex in the graph. Here, there must not be a positive integer at most $K$ that is not written in any vertex.\n\nFind the number of possible graphs that can be obtained, modulo $P$. ($P$ is a **prime**.)\nTwo graphs are considered the same if and only if one can label the vertices in each graph as $v_1, v_2, \\dots, v_N$ to satisfy the following conditions.\n\n*   For every $i$ such that $1 \\leq i \\leq N$, the numbers written in vertex $v_i$ in the two graphs are the same.\n*   For every $i$ and $j$ such that $1 \\leq i \\lt j \\leq N$, there is an edge between $v_i$ and $v_j$ in one of the graphs if and only if there is an edge between $v_i$ and $v_j$ in the other graph."},{"iden":"constraints","content":"*   $1 \\leq K \\leq N \\leq 30$\n*   $10^8 \\leq P \\leq 10^9$\n*   $P$ is a prime.\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $K$ $P$"},{"iden":"sample input 1","content":"3 1 998244353"},{"iden":"sample output 1","content":"4\n\nThe following four graphs satisfy the condition.\n![image](https://img.atcoder.jp/ghi/abc283h_43c4abe0e541b7ebeaa8db2854cece91caeca71f03f452ca13c11e82f85e3a56.png)"},{"iden":"sample input 2","content":"3 2 998244353"},{"iden":"sample output 2","content":"12\n\nThe following $12$ graphs satisfy the condition.\n![image](https://img.atcoder.jp/ghi/abc284h2_ca96b7cb451b0e495209e3e201576d278de3fb823e5d2404bbce5d9f704e3259.png)"},{"iden":"sample input 3","content":"5 5 998244353"},{"iden":"sample output 3","content":"1024"},{"iden":"sample input 4","content":"30 15 202300013"},{"iden":"sample output 4","content":"62712469"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}