Your team was exploring an ancient city. Suddenly you found an old scroll with 2 integer numbers N and K, which encrypts the secret code to open a treasure box. Considering a transformation on an integer X described as follows:
X = X + X mod 100,
the secret code can be obtained by applying the above-described transformation K times successively to N.
The input file consists of several datasets. The first line of the input file contains the number of datasets which is a positive integer and is not greater than 500.
Each dataset has two space-separated positive integers N and K (1 ≤ N ≤ 109, 1 ≤ K ≤ 109) written on a single line.
For each dataset, write on a single line the secret number decrypted from N and K.
2
31102014 2
10101 10
31102056
10324