long long quick_pow(int a,int n) { long long result; if(n == 1) return a; if(!n) return 1; long long mid = quick_pow(a,n/2); if(n%2) result = mid*mid%modx*a%modx; else result = mid*mid%modx; return result; //zzzzz }