inline lint pow(lint a, lint b, lint p) { lint rtn = 1; while (b) { if (b & 1) rtn = rtn * a % p; a = a * a % p; b >>= 1; } return rtn; }