Count how many ways there are to color a m × n chessboard with black and white, such that the black blocks are 4-connected, and the white blocks are also 4-connected.
Three space-separated integers n, m, p. (1 ≤ m ≤ 8, 1 ≤ n·m ≤ 104, 2 ≤ p ≤ 109, p is prime.)
Output the answer modulo p.
2 2 998244353
14
4 3 998244353
294
3 3 998244353
108
Example 3 has the following 108 ways:
| Name |
|---|


