A squarer is a simple and convenient device. You give it some positive integer X and it calculates its square.
Leha is implementing a module of this device which is responsible for squaring the numbers consisting of multiple repetitions of one digit. But it turned out that it's not as simple as he thought.
Please help him now!

-----Input-----
The first line contains one integer T denoting the number of testcases. The descriptions of T test cases follow.
Each of the following T lines contain 2 space-separated integers - N and D, respectively. It means that the number X in the corresponding testcase consists of the digit D repeated N times (in decimal representation).

-----Output-----
As the answer can be very large, we ask you to output its hash which is computed in the following way:
Let's consider the integer answer Y as a 0-indexed array starting from its leftmost digit. The hash function is calculated as:
p0*Y[0] + p1*Y[1] + ... + pM-1*Y[M-1] modulo 109 + 7 
where M is the length of the array representation of Y and p equals 23.

-----Constraints-----
- 1 ≤ T ≤ 20
- 1 ≤ D ≤ 9
- Subtask 1 (16 points): 1 ≤ N ≤ 9
- Subtask 2 (25 points): 1 ≤ N ≤ 100
- Subtask 3 (27 points): 1 ≤ N ≤ 2 × 104
- Subtask 4 (32 points): 1 ≤ N ≤ 106

-----Example-----
Input:3
1 4
3 6
3 5

Output:139
40079781
32745632

-----Explanation-----
In the first test case, X = 4 and Y = 16. Its hash equals 1*1 + 23*6 = 139.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'mod=1000000007\ndp =[]\ndp.append(1)\ntens=[]\ntens.append(10)\ntws=[]\ntws.append(1)\nfor i in range(1, 21):\n tens.append(tens[i-1]*tens[i-1])\n dp.append(dp[i-1]*tens[i-1]+dp[i-1])\n tws.append(tws[i-1]*2) \n\nt=eval(input())\nt=int(t)\nfor i in range(0, t):\n now=0\n b, a = input().split()\n a=int(a)\n b=int(b)\n j=20\n val=0\n while(j>=0):\n  if(b>=tws[j]):\n   val*=tens[j]\n   val+=dp[j]\n   b-=tws[j]\n  j-=1\n val*=a\n act=val*val\n now=str(act)\n # print(now)\n dow=1\n ans=0\n for c in now:\n  x=int(c)\n  # print(x)\n  # print(dow)\n  ans+=(dow*x)\n  dow*=23\n  dow%=mod\n  ans%=mod\n print(ans)\n # digs=[]\n # while(act >0):\n #   d=act%10\n #   digs.append(d)\n #   act=act/10\n # now=0\n # while (act > 0):\n #   d=act%10\n #   now*=10\n #   now+=d\n #   act=act/10\n # count=0\n # ans=0\n # mul=1\n # while (now > 0):\n #   d=now%10\n #   ans+=(mul*d)\n #   ans%=mod\n #   now/=10\n #   count+=1\n #   mul*=23\n #   mul%=mod\n # print(ans)\n\n\n\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 3582650