int Pow(int a, int b, int c) { int ret = 1; while (b) { if (b & 1) ret = ret * 1ll * a % c; a = a * 1ll * a % c; b >>= 1; } return ret; }