Today Oz is busy with cool numbers. Cool numbers are positive integers whose decimal representation contains only the cool digits 2 and 5. For example, numbers 25, 522, 2 are cool and 7, 15, 265 are not.
Let f(k) be the smallest cool number greater than or equals k. Oz is interested what is the value of the following expression for a given pair (l,r) :
The first line of input contains an integer T - number of test cases. Each test case consist of two integers l and r.
For each test case output required answer.
1 ≤ T ≤ 50
1 ≤ l ≤ r ≤ 109
In the first sample: