Fax McClad, Croneria's most curious bounty hunter, is interested certain numbers.

A number is called a **palindrome** if it is the same when read left-to-right or right-to-left. For example, is a palindrome, and is not. Leading zeroes are not part of a palindrome. For example, is not a palindrome.

Fax also loves the number and any multiple of it.

Fax is interested in the palindromes that are divisible by between and , inclusive. He will do this times. Can you tell him how many of these numbers there are?

#### Input Specification

The first line of input will contain and .

The lines of input follow. Each line will contain and .

For of the points, .

For an additional of the points, , .

#### Output Specification

On separate lines, print the answer to each query.

#### Sample Input

```
2 2
10 50
100 300
```

#### Sample Output

```
2
10
```

#### Explanation for Sample Output

For the first query, are the only palindromes in between and . Only and are divisible by .

## Comments