Interesting Ranges

No attempts yetTime limit45sMemory 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.

For integers LRL \le R, the range [L,R][L, R] is the sequence of integers from LL to RR inclusive: (L,L+1,L+2,,R1,R)(L, L+1, L+2, \dots, R-1, R). A range is interesting if the number of palindromes in it is even. A range with no palindrome at all is interesting, because zero is even.

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. Given LL and RR, count the interesting subranges of [L,R][L, R].

Input

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

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 1000000007.

Limits

  • 1T1201 \le T \le 120
  • 1LR101001 \le L \le R \le 10^{100}