Each mapping of the set \{0,1\}^n of -dimensional binary vectors to is called Boolean function of variables and denoted by f(x_n,x_{n-1},...,x_1). For cryptography some properties of the Boolean functions are interesting. Let denote by B(n,k) the set of -dimensional binary vectors that have 's. The task is for given Boolean function to find the number of vectors (b_n,b_{n-1},...,b_1) from B(n,k) such that f(b_n,b_{n-1},...,b_1)=1.
The Boolean function will be given by its (unique) polynomial modulo . In these polynomials the operations addition and multiplication modulo are used, defined as shown in the tables of Fig. 1. In the polynomial of a function any product of variables x_{i1} x_{i2} ... x_{im} could participate or not participate. So the general form of the polynomial for variables is:
where all coefficients a_j, j=0,1,...,N=2^n-1, are 's or 's and if the coefficient is equal to we will omit the corresponding product and if it is equal to we just will omit the coefficient. For example, the polynomial of the Boolean function disjunction of variables given on Fig. 2 is 0+1 \cdot x_1+1 \cdot x_2+1 \cdot x_2x_1=x_1+x_2+x_2x_1.

Your program has to be ready to solve more than one test case. The first line of the input file will contains only the number of the test cases. Each of the following lines will describe one function - first the numbers and separated by single space (1 \le n \le 18, 0 \le k \le n) and then, separated by one more space a string of 2^n 's and 's that are the coefficients of the corresponding polynomial, ordered as in the general form of the polynomial given above.
The output file has to contain lines with a single number each - the number of vectors found by your program.
Example 1