classSolution { public: intsuperPow(int a, std::vector<int>& b){ autopow = [](longlong a, longlong b) { longlong res = 1; while(b) { if(b & 1) { res = (res * a) % 1337; } b >>= 1; a = (a * a) % 1337; } return res; };

longlong res = 1; for(int i = 0; i < b.size(); i++) { res = pow(res, 10) * pow(a, b[i]) % 1337; } return res; } };