Self-Describing Sequences

No attempts yetTime limit1sMemory limit256 MB

Problem

You are given a natural number NN. A sequence A=(A0,A1,,AN1)A = (A_0, A_1, \ldots, A_{N-1}) of length NN is self-describing when the following holds for every ii with 0i<N0 \le i < N.

AiA_i equals the number of times the value ii occurs in AA.

Count the self-describing sequences of length NN.

Input

The first line contains a natural number TT, the number of test cases. Each of the next TT lines contains one sequence length NN (1N100)(1 \le N \le 100).

Output

For each test case, print on one line the number of self-describing sequences of length NN, taken modulo 1,000,000,007.

Hint

For N=5N = 5 the only sequence that satisfies the condition is (2,1,2,0,0)(2, 1, 2, 0, 0). For N=4N = 4 there are two, (2,0,2,0)(2, 0, 2, 0) and (1,2,1,0)(1, 2, 1, 0).