A positive integer number is lucky if and only if any three digits of it are not increasing or decreasing, and any two digits of it are different. The numer that has less than three digits is lucky number if no two digits of it are the same. For example, 123 and 321 are not lucky numbers. 132 is a lucky number. please count the quantity of lucky numbers in given ranges.
The first line of the input contains the number of cases t. Each of the next t lines contains two natural numbers li and ri (1 ≤ li ≤ ri ≤ 1000000) .
Output should contain t numbers — answers to the queries, one number per line — the quantities of lucky numbers in given intervals (from li to ri, inclusively).