Time Limit: 2000 MS Memory Limit: 65536 K

## Description

There are N equations:
A_{00}*X_{0} + A_{01}*X_{1} + A_{02}*X_{2} + ... + A_{0M-1}*X_{M-1} = B_{0}
A_{10}*X_{0} + A_{11}*X_{1} + A_{12}*X_{2} + ... + A_{1M-1}*X_{M-1} = B_{1}
A_{20}*X_{0} + A_{21}*X_{1} + A_{22}*X_{2} + ... + A_{2M-1}*X_{M-1} = B_{2}
......
A_{N-10}*X_{0} + A_{N-11}*X_{1} + A_{N-12}*X_{2} + ... + A_{N-1M-1}*X_{M-1} = B_{N-1}
All the operation is module 2.
All the X is 0 or 1.
How many solutions for the N equations?
## Input

The first line of input is the number of test case.
For each test case:
The first line contains two integers N and M.
The next N lines each contains M+1 integers, A_{ij} and B_{i}.
There is a blank line before each test case.
1 <= N,M <= 15
0 <= A_{ij},B_{i} <= 1
## Output

For each test case output the answer on a single line.
## Sample Input

3
3 4
1 0 1 0 0
1 1 0 0 0
1 1 1 0 1
4 3
1 1 0 1
0 0 1 0
0 1 0 1
1 1 0 0
4 3
1 1 0 1
0 0 1 0
0 1 0 1
1 1 0 1
## Sample Output

2
0
1
## Source

8th SCUPC
## Author

windy7926778