Writer : jjjjj19980806
Description : pclightyear
jjjjj doesn't like long description.
Given integers a, n, p, please calculate the value of an mod p.
The first line contains an integer T, representing the number of testcases.
Each testcase contains a line with three integer a, n, m.
It is guaranteed that :
For each testcase, please output a line contains one integer representing your answer.