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 = 'import sys\n\nMAX_N = 20\nMAX_DIG = 3\ndp = [[0] * (MAX_DIG + 1) for i in range(MAX_N)]\n\ndef calc_dp():\n    dp[0][0] = 1\n    for i in range(1, MAX_N):\n        dp[i][0] = 1\n        for j in range(MAX_DIG):\n            dp[i][j + 1] += 9 * dp[i - 1][j]\n            dp[i][j + 1] += dp[i - 1][j + 1]\n\ndef first_dig(n):\n    cnt = 0\n    while n >= 10:\n        n //= 10\n        cnt += 1\n    return n, cnt\n\ndef calc_ans(n):\n    ans = 0\n    for n_digs in range(MAX_DIG, -1, -1):\n        x, cnt = first_dig(n)\n        for i in range(n_digs):\n            ans += x * dp[cnt][i]\n        ans += dp[cnt][n_digs]\n        n -= x * 10 ** cnt\n    return ans\n\ndef main():\n    calc_dp()\n    T = int(input())\n    for _ in range(T):\n        l, r = map(int, input().split())\n        print(calc_ans(r) - calc_ans(l - 1) if l > 0 else 0)\n\ndef __starting_point():\n    main()\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 17905