Mr. Seth is worried about the situation of the COVID pandemic. So he decided to safeguard people by defining place for the Kth person. Place for Kth person is defined as A(k) = F(x,k) + F(y,k) where function F is defined as:
F(a,b) = (a * ( fact(b) % 10 ) ) % 10 ^ ( b * ( fact(a) % 10 ) ) % 10,
where '^' and fact denotes XOR operator and factorial operator respectively.
As Mr. Seth is confused in the function, help him in finding the place of Kth person.
Input Format:
The First line contains T describing the test cases.
Next T lines have three space-separated integers x, y, and k.
Output Format:
Print place of Kth person in each test case.
Constrainsts:
In the first test case A(5) = F(1,5) + F(2,5) where F(1,5) = 5 and F(2,5) = 0. Hence A(5) is 5.