alt

#include<iostream>
#include<math.h>
using namespace std;
int main() {
    long long n;
    while (cin >> n) {
        if (n == 0)
            break;
        long long start=pow(5,n)-4;
        long long old =n+pow(4,n)-4;
        cout<<start<<' '<<old<<endl;
    }
    return 0;
}