Given A and B, count the numbers N such that A ≤ N ≤ B and N is a palindrome.   

Examples: 
Palindromes: 121, 11 , 11411 
Not Palindromes: 122, 10

Input: 
First line contains T, the number of testcases. Each testcase consists of two integers A and B in one line.

Output: 
For each testcase, print the required answer in one line.

Constraints: 
1 ≤ T ≤ 10 
0 ≤ A ≤ B ≤ 10^5

SAMPLE INPUT
2
10 13
20 30

SAMPLE OUTPUT
1
1
n = input()
def check_palindromic(x):
    if str(x) == str(x)[::-1]:
        return True
    return False

kq = []
for i in range(n):
    dem = 0
    nhap = list(map(lambda x: int(x), raw_input().split()))
    for j in range(nhap[0], nhap[1]+1):
        if check_palindromic(j) == True:
            dem += 1
    kq.append(dem)
for i in kq:
    print i