P16018 [HackerEarth] Kandy had a dream in which he dreamt of the Good String. The impact of that string was so much that it forced Kandy to calculate the number of possible Good Strings after he woke up.
普及
题目描述

Kandy had a dream in which he dreamt of the Good String. The impact of that string was so much that it forced Kandy to calculate the number of possible Good Strings after he woke up.
Kandy is afraid to code right now. So, he mails you the required conditions to calculate the number of possible Good Strings. Some properties of these strings include:-
They are of given specific length.
They consist of digits only between 0-9 (both inclusive).
They may have leading zeros.
They have certain Good Product which is defined as product of
digits in the string.
Their F(Good Product) is always greater than 0.

F(P) is calculated as Bitwise XOR of all the prime factors of P.

For eg: 12 is written as 22 * 31
Therefore, F(12) = 2 xor 2 xor 3 = 3

Input:
First line of the input consists of number of testcases T
Next T lines consists of length of the Good String N

Output:
Print the number of possible Good Strings modulo 10^9+7 of given length N for each test case in a separate line.

Constraints:
Subtask 1:
1 ≤ T ≤ 100
1 ≤ N ≤ 105
Subtask 2:
1 ≤ T ≤ 10
1 ≤ N ≤ 1018

Note:
Leading zeros in the string also contribute to its product of digits which would be zero anyway.

SAMPLE INPUT
5
1
5
7
8
2

SAMPLE OUTPUT
6
52806
4370778
39585232
64

Explanation

[Case 1:] For N = 1, possible evil strings are "2","3","5","6","7","8". Their F(Evil Product) is greater than 0.

Rest of the cases is for you to figure out.

输入格式

见题面

输出格式

见题面

样例输入
100 41 18467 6334 26500 19169 15724 11478 29358 26962 24464 5705 28145 23281 16827 9961 491 2995 11942 4827 5436 32391 14604 3902 153 292 12382 17421 18716 19718 19895 5447 21726 14771 11538 1869 19912 25667 26299 17035 9894 28703 23811 31322 30333 17673 4664 15141 7711 28253 6868 25547 27644 32662 32757 20037 12859 8723 9741 27529 778 12316 3035 22190 1842 288 30106 9040 8942 19264 22648 27446 23805 15890 6729 24370 15350 15006 31101 24393 3548 19629 12623 24084 19954 18756 11840 4966 7376 13931 26308 16944 32439 24626 11323 5537 21538 16118 2082 22929 16541
样例输出
508243780 913994771 233025121 583416323 676078457 386085457 642774079 431248776 659469303 900824597