403178: GYM101061 G Repeat it
Description
Jad has bought a new computer, a really weird computer!!
Every time he copies some number from the screen and pastes it, the computer pastes it many times instead of once!
Jad tested his computer many times, and now he knows how many times the computer will paste each copied number.
For example, In case the new computer repeated each copied number 4 times. When Jad copies the number 31 and pastes it, the number that appears on the screen would be 31313131.
Given N the number that Jad copied, and M the number of times the new computer is pasting each copied number. you have to print the number that will appear on the screen.
Since the number might be very big, you are asked to print it modulo 1000000007.
InputThe first line of the input consists of a single integer t, the number of test cases. Each test case consists of two numbers M and N separated by a single space:
(1 ≤ M ≤ 109) is the number of times the new computer pasted the number N.
(0 ≤ N ≤ 109) is the number Jad had copied.
OutputFor each test case print one line, the number that will appear on the screen modulo 1000000007.
ExampleInput3Output
4 31
8 1
123 123
31313131
11111111
388853804