15055 - RedCapeFlyingCat's Reverse and Add   

Description

RedCapeFlyingCat likes to play with numbers by reading them backwards.

For a positive integer , let be the number obtained by writing the decimal digits of in reverse order and dropping any leading zeros. For example, and .

One operation replaces with .

A positive integer is a palindrome if it reads the same forwards and backwards, that is, if .

You are given queries. Each query consists of two integers and . Start with and perform the operation exactly times, even if becomes a palindrome earlier. Report the final value of and whether it is a palindrome.

Explanation

The sample test case has queries.

  • , : . The final value is a palindrome.
  • , : . The final value is not a palindrome.
  • , : is already a palindrome, but the operation is still performed once: , which is a palindrome.
  • , : no operation is performed. The final value is a palindrome.

Input

The first line contains one integer , the number of queries.

Each of the next lines contains two integers and , separated by a single space.

Constraints

  • All input values are integers

Output

For each query, output one line containing the final value of , followed by a single space, followed by Yes if the final value is a palindrome and No otherwise.

Sample Input  Download

Sample Output  Download




Discuss