/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Scanner input
= new Scanner
(System.
in); double A = 0;
double B = 0;
double M = 0;
System.
out.
println("\n\nHow many sets?"); int s = input.nextInt();
double X[] = new double[s];
for(int i = 0; i<s; i++)
{
A = input.nextDouble();
B = input.nextDouble();
M = input.nextDouble();
X
[i
] = (Math.
pow(A, B
)) % M
; //(A^B)%M }
for(int j = 0; j<s; j++)
{
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJIFNjYW5uZXIgaW5wdXQgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgICAgIGRvdWJsZSBBID0gMDsKICAgICAgICBkb3VibGUgQiA9IDA7CiAgICAgICAgZG91YmxlIE0gPSAwOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiXG5cbkhvdyBtYW55IHNldHM/Iik7CiAgICAgICAgaW50IHMgPSBpbnB1dC5uZXh0SW50KCk7CiAgICAgICAgZG91YmxlIFhbXSA9IG5ldyBkb3VibGVbc107CiAgICAgICAgZm9yKGludCBpID0gMDsgaTxzOyBpKyspCiAgICAgICAgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkE6ICIpOwogICAgICAgICAgICBBID0gaW5wdXQubmV4dERvdWJsZSgpOwogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkI6ICIpOwogICAgICAgICAgICBCID0gaW5wdXQubmV4dERvdWJsZSgpOwogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIk06ICIpOwogICAgICAgICAgICBNID0gaW5wdXQubmV4dERvdWJsZSgpOwogICAgICAgICAgICBYW2ldID0gKE1hdGgucG93KEEsIEIpKSAlIE07ICAvLyhBXkIpJU0KICAgICAgICB9CiAgICAgICAgZm9yKGludCBqID0gMDsgajxzOyBqKyspCiAgICAgICAgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50KE1hdGgucm91bmQoWFtqXSkgKyAiICIpOwogICAgICAgIH0KCX0KfQ==