Our programmer friend Micro just taught his son, Micro Junior, how to read a clock. Few days back he also taught him about palindromes. Now as we know that Micro Junior looks for opportunities to trouble his father, so he started asking him questions. He asked him T questions. In each he gave his father a starting time and an ending time and asked the number of times in between which are palindromes (see sample explanation for more clarity) . Now Micro asked for your help to solve this problem.
Input:
The first line consists of T, the number of questions.
Next T lines consist of a starting time S and an ending time E separated by a space. Time is given in 24-hour format without any colons. (See sample input)
Output:
Print the answer for each question in a new line.
Constraints:
1 ≤ T ≤ 1000
It is assured that every time given is valid. Time starts from 0000 to 2359
S ≤ E