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 = "#      \nimport collections, atexit, math, sys, bisect \n\nsys.setrecursionlimit(1000000)\ndef getIntList():\n    return list(map(int, input().split()))    \n\ntry :\n    #raise ModuleNotFoundError\n    import numpy\n    def dprint(*args, **kwargs):\n        print(*args, **kwargs, file=sys.stderr)\n    dprint('debug mode')\nexcept ModuleNotFoundError:\n    def dprint(*args, **kwargs):\n        pass\n\n\n\ninId = 0\noutId = 0\nif inId>0:\n    dprint('use input', inId)\n    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件\nif outId>0:\n    dprint('use output', outId)\n    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件\n    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit\n    \nN, = getIntList()\ndef memo(func):  \n    cache={}  \n    def wrap(*args):  \n        if args not in cache:  \n            cache[args]=func(*args)  \n        return cache[args]  \n    return wrap\n\n@memo\ndef comb (n,k):\n    if k>n: return 0    \n    if k==0: return 1\n    if n==k: return 1\n    return comb(n-1,k-1) + comb(n-1,k)\ndef getclam(K, left = 3):\n    if K==0: return 1\n    if left ==0: return 1\n    s = str(K)\n    l = len(s)\n\n    r = 0\n    x = int(s[0])\n    if l>1:\n        for i in range(left+1):\n            r += comb(l-1,i) * 9 ** i\n        if x>0:\n            for i in range(left):\n                r += comb(l-1,i) * 9 ** i * (x-1)\n        s1 = s[1:]\n        y = 0\n        if s1:\n            y = int(s1)\n        if x!=0:\n            left-=1\n        r+= getclam( y, left)\n        return r\n    else:\n        return x+1\nfor i in range(1000, 1100):\n    continue\n    dprint(i, getclam(i))\n\nfor _ in range(N):\n    L,R = getIntList()\n    r = getclam(R) - getclam(L-1)\n    print(r)\n\n\n\n\n\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 6171336