Handsome multisets

아직 제출이 없습니다시간 제한15초메모리 제한256 MB

문제

Call a multiset of positive integers A=a_1,a_2,,a_kA = \\{a\_1, a\_2, \ldots, a\_k\\} nn-handsome if the sum of its elements is equal to nn, and each integer from 11 to nn can be uniquely represented as a sum of its elements up to their order. For example, 1,2,4\\{1, 2, 4\\} is 77-beautiful, 1,1,3\\{1, 1, 3\\} is 55-beautiful. Given an integer nn, find the following sum: \[\left(\sum\limits_{A\text{ is }n\text{-beautiful}}|A| \right) \bmod p.\]

You can choose p=109+7p = 10^9 + 7 or p=109+9p = 10^9 + 9 by yourself for each nn you are computing the answer.

입력

The first line contains an integer tt (1t51 \le t \le 5) -- the number of test cases in the input file.

Each of the next tt lines contain one integer n_in\_i (1n_i10161 \le n\_i \le 10^{16}), for which you need to output the answer. It is guaranteed that all n_in\_i in one file are different.

출력

Output tt lines. The ii-th of them should contain the answer for the number n_in\_i. Each answer has to be correct either with p=109+7p = 10^9 + 7 or p=109+9p = 10^9 + 9, and pp can be chosen independently for each test case. Note that you should not output the chosen pp, only the remainder of the answer.