#include #include #include using namespace std; typedef unsigned long long INT; #define mul(a,b,m) ((a)*(b)%(m)) const INT MOD = 1000000007; INT A, B, C; void input() { string s; cin >> s; int n = 0; for (; isdigit(s[n]); n++) { A = (A * 10) + (s[n] - '0'); } n++; for (; isdigit(s[n]); n++) { B = (B * 10) + (s[n] - '0'); } n++; for (; isdigit(s[n]); n++) { C = (C * 10) + (s[n] - '0'); } } INT modpow(INT x, INT n, INT mod) { INT r = n? 1: 0; while (n) { if (n & 1) { r = mul(r, x, mod); } x = mul(x, x, mod); n >>= 1; } return r; } int main() { input(); cout << modpow(modpow(A%MOD, B, MOD), C, MOD) << ' '; cout << modpow(A%MOD, modpow(B%(MOD-1), C, MOD-1), MOD) << endl; }