#pragma GCC optimize("Ofast") #pragma GCC optimize(2) #pragma GCC target("popcnt") #include using namespace std; typedef long long ll; typedef string str; typedef pair pii; #define F first #define S second #define pb push_back #define all(x) (x).begin(),(x).end() #define de_bug(x) cout << (x) << '\n' #define loli(x) cout << (x) << ' ' #define yn(x) cout << (x==1?"Yes\n":"No\n") #define PI 3.14159265358979323 #define Ststone ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) const ll max_n=2e5+10,mod=10000000; ll t,k,n,m,h,q,a,b; vector v; str s; char c; template T modpow(T a, T b) { a %= mod; T c = 1; while (b > 0) { if (b & 1) c = (c * a) % mod; a = (a * a) % mod; b >>= 1; } return c; } int main(){ Ststone; cin >> a >> n; m = 10000000; cout << m << '\n'; cout << modpow(a,n) << '\n'; } /* 49 64 8 4 17 17 */