#include<bits/stdc++.h> using namespace std; typedef long long ll; ll exgcd(ll a,ll b,ll &x,ll &y) { if(!b){x=1;y=0;return a;} ll res=exgcd(b,a%b,x,y),t; t=x;x=y;y=t-a/b*y; return res; } ll p; inline ll power(ll a,ll b,ll mod) { ll sm; for(sm=1;b;b>>=...