As you all know, MOD is a mathematical operatio. Giving you two numbers n,m(0 < m,n <= 1010001)，Your task is to calculate the sum of every digit of m MOD every digit of n. We can guarantee that there is no zero in digits of n.
The first line, a integer T, representing T test cases blew.(T<=10).
In each case, the first line is the integer m, the second line is the integer n.
Print the sum of every digit of m MOD every digit of n.