In this problem, you are given a grid of size R \!\times\! C (1 \leq R \leq 10^9 and 1 \leq C \leq 10). There are blocks (0 \leq B \leq 100) placed in the grid. Each block occupies a cell, and a cell may contain more than one block.
You are also given identical tokens. You can place these tokens in the first row in any way you like. No cell can contain more than one token, and you cannot place a token in a cell already occupied by blocks. After placement, you may move the tokens according to the following rules:
If a token is at cell , it can be moved to (r{+}1, c{-}1) or (r{+}1, c{+}1).
A token cannot be moved into a cell occupied by blocks.
A token cannot be moved outside the grid.
No two or more tokens can be moved into the same cell.
All tokens must be moved to the -th row before any token can be moved to the -th row.
Let S = \{(1, c_1), (1, c_2), \ldots, (1, c_M)\} be the set of cells where you placed the tokens. Let be the number of ways to move these tokens to the last row, following the rules above. Find the sum of over all possible .
For R = 2, C = 2, M = 1 and B = 0, the answer is 2.

The first line contains the number of test cases 1 \leq T \leq 500. For each test case, the first line contains , and (1 \leq R \leq 10^9, 1 \leq C \leq 10, 0 \leq M \leq C). The second line contains (0 \leq B \leq 100). Then follow lines, each containing two integers and (1 \leq r \leq R, 1 \leq c \leq C), giving the cell position of each block.
For each test case, output the answer on a single line. As the answer may be very large, output the answer modulo 12345.
Example 1