SP7683 CSQUARE - Powered and Squared

Description

N/A

Input Format

First line of input contains a number T, number of test cases. Then T test cases follows each containing three numbers a (

Output Format

Output a number for each test case a^b mod m in base 10.