Problem B. 2
Input file name: standard input
Output file name: standard output
Time limit: 2 s
Memory limit: 64 MB

Seka apibrėžta formule:

F(0) = a

F(1) = b

F(N) = F(N-1) + F(N-2)

Jums reikia atsakyti Q užklausų. Kiekvienoje duota a,b,N ir M. Reikia rasti sekos N-tojo nario liekaną dalinant iš 10^M.

Input

Q < 10001, a,b < 101, N < 1000000001, M < 8

Example

standard input standard output
4
0 1 11 3
0 1 42 4
0 1 22 4
0 1 21 4
89
4296
7711
946
16
0 1 14 1
0 1 24 1
0 1 74 1
25 67 3 1
98 25 1000000000 1
0 1 9842 2
34 88 224242 2
100 100 10 2
56 24 83943 3
89 14 983821 3
1 100 1000000000 4
45 64 999999999 4
0 0 100000 4
100 90 0 4
41 67 1 3
55 89 2 4
7
8
7
9
3
21
92
0
664
54
8126
1269
0
100
67
144