#include<iostream> using namespace std; typedef long long LL; LL Pow(LL a,LL b,LL p){ a%=p; LL res=1; while(b){ if(b&1){ res=(res*a)%p; res%=p; } a=(a*a)%p; b>>=1; } return res; } int main(){ LL a,b,p...