Given two numbers a and b, find kth digit from right of a^b.
The first line of the input contains T denoting the number of test cases.Each of the next T lines contains three space separated positive integers denoting the value of a , b and k respectively.
For each test case, output the kth digit from right of a^b in new line.
1<=a , b <=15
1<=k<=|totaldigits in a^b|
3 3 1
5 2 2