P21439 [HackerEarth] Background:
普及
题目描述

Background:
Mehta had a horrible nightmare in which he dreamt of the Evil String. The impact of that string was so much that it forced Mehta to calculate the number of possible Evil Strings after he woke up.

Task:
Mehta is afraid to code right now. So, he mails you the required conditions to calculate the number of possible Evil 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 Evil Product which is defined as product of digits in the string.
Their F(Evil 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 2^2 * 3^1
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 Evil String N

Output:
Print the number of possible Evil 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 ≤ 10^5
Subtask 2:
1 ≤ T ≤ 10
1 ≤ N ≤ 10^18

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

Problem statement in native language : http://hck.re/Lo1koZ

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.

输入格式

见题面

输出格式

见题面

样例输入
10 1982731923173794 1982731923192220 1982731923180087 1982731923200253 1982731923192922 1982731923189477 1982731923185231 1982731923203111 1982731923200715 1982731923198217
样例输出
26379800 332275541 813016939 161857610 88918785 777040774 86680014 818514806 223512126 594783401 59282289 967878651 934205219 615863954 966239223 595424397 387632537 545713324 138733125 728154990 776191030 73589080 420347121 397879275 370470872 90082263 514627179 596397848 252491781 262969283 236038082 649925148 597368702 813161347 915732297 571207172 73423072 748329846 937958102 266031025 907292789 823054176 948458998 894453837 880373745 807494742 321356254 15675727 210808292 269829596 337503725 271414183 317934486 883543954 254195375 862364573 919766403 674828011 518101035 804222553 138792413 968468171 17646575 529357272 832316731 703972753 39781247 696724192 337835244 255149586 527683405 494098691 571310099 797298576 373261520 461758243 895905215 960334688 455986476 263879615 27913318 629054964 41705246 930138284 699097467 781315930 178720085 75708178 560579998 765867931 969676449 71138822 123054003 243396778 667925022 398117452 172899631 867508731 122406499 640671211