Welcome to the world of happy numbers. In this world, only digits and are happy while the rest are unhappy, so happy numbers are those composed of s and s, e.g. and are unhappy but and are happy numbers.
Given two numbers and , print the amount of happy numbers in the range such that .
The input starts with the number of test cases . For each test case, there are two integers and that corresponds to range where we have to look for happy numbers.
For each test case, output the total number of happy numbers in the range .
In the first example, in only and are happy so the answer is .
In the second example, in , the happy numbers are , , , , and so the answer is .
Input
2 1 10 44 450
Output
2 6