Find the number of different correct bracket sequences consisting of k_1 pairs of brackets of the first type, k_2 pairs of brackets of the second type, ..., k_m pairs of brackets of the -th type.
A bracket sequence is considered correct if:
The empty sequence is correct;
If is correct and is correct, then is correct;
If is correct, then is correct, where and are the opening and closing brackets of the same type.
The first line contains the number of test cases (0 < n \leq 1000). Each of the following lines describes a test case. Each line starts with the number (0 < m \leq 100), the number of different types of brackets. Then positive integers k_1, k_2, \ldots, k_m follow, each separated by a space. Here, k_i is the number of pairs of brackets of the -th type. The total number of bracket pairs does not exceed .
For each test case, output a line containing a single integer: the answer to the problem modulo .
Example 1