#include using namespace std; int main(){ long long a,n;cin>>a>>n; long long nw = 1; while(n && nw<10000000){ nw *= a; n--; } if(!n){ cout << 10000000 << endl; cout << nw << endl; }else{ cout << nw << endl; cout << 0 << endl; } }