Lights#1253

Lights

1 second
128 megabytes
Easy

John has bulbs and a switchboard with switches. Each bulb can be on or off; pressing the -th switch changes the state of bulb (from on to off and vice versa). He is using this setup to play a game of his invention. On each move, John chooses a (possibly empty) subset of switches and presses them, thereby toggling the states of the corresponding bulbs. After exactly moves, John wants the first bulbs to be on and the rest to be off; if this is not achieved, he loses. There is only one restriction: the same subset of switches cannot be pressed in two different moves.

This is a simple game as there are many ways to win. This encouraged him to try all possible winning games. Help John count the number of ways to win. Two games are considered the same if, after reordering the moves, the same subsets of switches are pressed in each move of both games.

For example, if n = 4, m = 3, and v = 2, one possible winning game is to press switches , , and in the first move; and in the second; and , , and in the last. This is considered equivalent to, for example, first pressing and , then , , , and finally , , .

Input

Contains at most lines, one per test case. Each line contains three integers (1 \leq n \leq 1000), (1 \leq m \leq 1000), and (0 \leq v \leq n). The last line contains and must not be processed.

Output

For each test case, print on a separate line the number of ways John can play the game, modulo the prime .

Examples

Example 1

Loading
Loading