Given an chess board, you can place on it as many black knights as you wish, as long as no two knights threaten each other. How many possibilities do you have?
For instance, these are just four of the 278 possibilities for and :
Input consists of several cases, each with and . Assume and .
For every case, print the number of possibilities modulo .
Input
1 1 1 10 2 1 3 4 4 2 4 10 4 1000000000000000
Output
2 1024 4 278 81 18702843 51397909