#include <bits/stdc++.h>
#define INT long long int
using namespace std;
char cmd[100];
int main()
{
    ios::sync_with_stdio(false);
    for(int n = 1 ; n <= 20 ; n++ )
    {
        sprintf(cmd, ".%d.in", n);
        freopen(cmd, "w", stdout);
        cout<<n<<endl;
        sprintf(cmd, ".%d.out", n);
        freopen(cmd, "w", stdout);
        if( n == 1 ) cout<<4<<endl;
        else
        {
            INT ans = 1;
            for(int i = 0 ; i < n ; i++ )
                ans *= 6;
            cout<<ans-1<<endl;
        }
    }
    return 0;
}
