We are given a three-dimensional, long and thin board consisting of unit cubes arranged into an A×B×C cuboid. Every cell can be described by a triple of integers (i,j,k), where 1≤i≤A, 1≤j≤B and 1≤k≤C. For every cell we know how many tokens are there initially --- in cell (i,j,k) there are a_i,j,k of them. In one move we can take one cell that has at least one token and move this token to one of cells (i+1,j,k), (i,j+1,k) or (i,j,k+1), provided that such cell exists.
Moreover, for every cell we are given a number b_i,j,k. Your task is to determine whether it is possible to perform some number of moves (possibly zero), so that for every cell (i,j,k) number of tokens that end up there is exactly b_i,j,k.
First line contains an integer t (1≤t≤10,000), denoting the number of testcases.
Then descriptions of t testcases follow. Each of them starts with a line containing three integers A, B, C (1≤A≤10,000, 1≤B,C≤6), denoting dimensions of the board. Then there are A blocks of B rows. Each of these rows contains C numbers --- k-th number in j-th row of i-th block is a_i,j,k (0≤a_i,j,k≤1012). Then, in analogous format, numbers b_i,j,k are given (0≤b_i,j,k≤1012).
Every testcase contains 2A blocks in total. Every two consecutive blocks are separated by an empty line for the sake of readability. Within every testcase, the sum of values a_i,j,k is equal to the sum of values b_i,j,k.
Sum of values of A over all testcases will not exceed 10,000.
Output should contain exactly t lines, one per each testcase. k-th line should contain a word TAK if in k-th testcase it is possible to find a required sequence of moves from the initial to the final state, or a word NIE otherwise.
Explanation to second sample test: Below we present sequence of moves leading from the initial to the final state:
2 2 2 2 2 1 2 1 1 1 1 1 1 1
2 1 2 0 2 1 1 1 2 1 1 2 1 2
-> -> -> -> -> ->
2 1 2 1 2 1 2 1 2 1 2 1 1 2
1 1 1 2 1 2 2 2 2 2 2 2 2 2