Ashley wrote a random number generator code.
Due to some reasons, the code only generates random positive integers which are not evenly divisible by 10. She gives $N$ and $S$ as input to the random number generator. The code generates a random number with number of digits equal to $N$ and sum of digits equal to $S$. The code returns -1 if no number can be generated. Print "-1" in such cases (without quotes). Else print the minimum possible product of digits of the random number generated.

-----Input:-----
- First line will contain a single integer $T$, the number of testcases. 
- Each testcase consists of two space separated integers, $N$ and $S$. 

-----Output:-----
For each testcase, output the answer on a new line.

-----Constraints-----
- $1 \leq T \leq 10^5$
- $1 \leq N \leq 18$
- $1 \leq S \leq 5 * N$

-----Sample Input:-----
2
1 5

2 2

-----Sample Output:-----
5

1

-----EXPLANATION:-----
In first testcase, the only possible number of length 1 having digit sum 5 is 5. And it's product of digits is 5. 
In second testcase,  only possible two digit number as a generator output is 11(as 20 is divisible by 10, it is never generated) and product of it's digits is 1.

```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 = '"""\n    Author : thekushalghosh\n    Team   : CodeDiggers\n"""\nimport sys,math\ninput = sys.stdin.readline\n############ ---- USER DEFINED INPUT FUNCTIONS ---- ############\ndef inp():\n    return(int(input()))\ndef inlt():\n    return(list(map(int,input().split())))\ndef insr():\n    s = input()\n    return(s[:len(s) - 1])\ndef invr():\n    return(map(int,input().split()))\n################################################################\n############ ---- THE ACTUAL CODE STARTS BELOW ---- ############\nt = 1\nt = inp()\nfor tt in range(t):\n    n,s = invr()\n    if n == 2 and s > 1:\n        print(s - 1)\n    elif n > 2 and s > 1:\n        print(0)\n    elif n == 1:\n        print(s)\n    else:\n        print(-1)'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13925