Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integernumberis beautiful ifand only ifitis divisible by each ofits nonzero digits. We will not argue with this and just countthe quantity of beautiful numbers ingiven ranges.
Input
The first line ofthe input containsthenumberof cases t (1 ≤ t ≤ 10). Each ofthe next t lines contains two natural numbers li and ri (1 ≤ li ≤ ri ≤ 9 ·1018).
Please, do not use %lld specificator toreadorwrite64-bit integers in C++. It is preffered to use cin (also you may use %I64d).
Output
Output should contain t numbers — answers tothe queries, one number per line — quantities of beautiful numbers ingiven intervals (from li to ri, inclusively).
Example
Input
119
Output
9
Input
11215
Output
2
Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with