Let's call some positive integer classy if its decimal representation contains no more than $3$ non-zero digits. For example, numbers $4$, $200000$, $10203$ are classy and numbers $4231$, $102306$, $7277420000$ are not.

You are given a segment $[L; R]$. Count the number of classy integers $x$ such that $L \le x \le R$.

Each testcase contains several segments, for each of them you are required to solve the problem separately.


-----Input-----

The first line contains a single integer $T$ ($1 \le T \le 10^4$) — the number of segments in a testcase.

Each of the next $T$ lines contains two integers $L_i$ and $R_i$ ($1 \le L_i \le R_i \le 10^{18}$).


-----Output-----

Print $T$ lines — the $i$-th line should contain the number of classy integers on a segment $[L_i; R_i]$.


-----Example-----
Input
4
1 1000
1024 1024
65536 65536
999999 1000001

Output
1000
1
0
2

```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 = 't=int(input())\nl=[]\nr=[]\nfor i in range (t):\n    q,w=[int(el) for el in input().split()]\n    l.append(q)\n    r.append(w)\n\ndef count(x):\n    if x<=1110:\n        return x\n    s=str(x)\n    n=len(s)\n    cz=3\n    out=0\n    for i in range(n-2): #пробежали до сотен\n        a=int(s[i])\n        k = n - i - 1  # осталось знаков после i\n\n        if a>0:\n            if cz==3:\n                out=out+k*(k-1)*(k-2)/6*9*9*9+k*(k-1)/2*9*9+k*9\n            elif cz==2:\n                out=out+k*(k-1)/2*9*9+k*9+1\n            elif cz==1:\n                out=out+k*9+1\n            cz=cz-1\n\n            if cz==2:\n                plus=k*(k-1)/2*9*9+k*9+1\n            elif cz==1:\n                plus=k*9+1\n            elif cz==0:\n                plus=1\n            out=out+plus*(a-1)\n        if cz==0:\n            break\n    if cz==0:\n        out=out+1\n        return out\n    if cz==1:\n#        out=out+1+int(s[n-2])\n        if int(s[n-2])>0:\n            out=out+int(s[n-2])+10\n        else:\n            out=out+1+int(s[n-1])\n        return out\n    out=out+int(s[n-2:])+1\n    return out\n\nfor i in range(t):\n    a=int(count(r[i]))\n    b=int(count(l[i]-1))\n    print(a-b)\n\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13143