Interesting Ranges (Small)

No attempts yetTime limit5sMemory limit512 MB

Problem

A positive integer is a palindrome if its decimal representation, written without leading zeros, reads the same forwards and backwards. For example, 5, 77, 363, 4884, 11111, 12121 and 349943 are palindromes.

A range of integers is interesting if it contains an even number of palindromes. For LRL \le R, the range [L,R][L, R] is the sequence of integers from LL to RR inclusive, that is (L,L+1,L+2,,R1,R)(L, L+1, L+2, \dots, R-1, R), and LL and RR are its first and last numbers. Zero is even, so a range that contains no palindrome at all is also interesting.

The range [L1,R1][L_1, R_1] is a subrange of [L,R][L, R] if LL1R1RL \le L_1 \le R_1 \le R. Determine how many subranges of [L,R][L, R] are interesting.

Input

The first line contains the number of test cases TT. Each of the next TT lines describes one test case and contains two positive integers LL and RR, in that order, separated by a single space.

Limits

  • 1T1201 \le T \le 120
  • 1LR10131 \le L \le R \le 10^{13}

Output

For each test case, print one line in the form Case #x: y, where xx is the test case number starting from 1 and yy is the number of interesting subranges of [L,R][L, R] modulo 10000000071000000007.