#include #define MOD 1000000007 typedef long long int LL; LL p(LL x, LL y, LL z) { if(x == 0 && y == 0) { return 0; } LL table[54]; table[0] = x; for(int i = 1; i < 54; i++) { table[i] = table[i - 1] * table[i - 1] % z; } LL ans = 1; for(int i = 0; i < 54; i++) { ans *= ((y>>i)&1 ? table[i] : 1); ans %= z; } return ans; } LL e(LL x, LL y) { return p(x, y, MOD); } LL f(LL x, LL y) { return p(x, y, MOD - 1); } int main () { LL a, b, c; scanf("%lld%*c%lld%*c%lld", &a, &b, &c); a %= MOD; printf("%lld %lld\n", e(e(a, b), c), e(a, f(b, c)) ); return 0; }