Given an extremely large non-negative integer n, you are asked to count the number of pairs (i,j) of integers satisfying the following conditions:
0≤j≤i≤n;
i∧n=i;
i∧j=0.
Here $\wedge $ represents the bitwise AND operator.
For simplicity, the binary representation of n will be given. Meanwhile, you only need to output the answer modulo (109+7).
Input
The first line contains an integer T (1≤T≤20) indicating the number of test cases.
Each of the following T lines contains a string S (1≤∣S∣≤105) which is the binary representation of the non-negative integer n. Note that leading zeros of S could appear in the input.
Output
For each test case, output a line containing the answer described above modulo (109+7).