#include using namespace std; long long pow(long long a, long long b) { long long ans = 1; while (b > 0) { if (b & 1) { ans *= a; } a *= a; b /= 2; } return ans; } int main() { long long a, n; cin >> a >> n; long long mod = a; int c = 1; while (mod < 1E7) { mod *= a; c++; } cout << mod << endl; if (c <= n) { cout << 0 << endl; } else { cout << pow(a, n) << endl; } }