#include <iostream>
#include <vector>
using namespace std;
int sum = 0;
vector <int> stick[4];
void f(int st, int ed, int value)
{
if (value == 1)
{
printf("%d : %d -> %d\n", stick[st].back(), st, ed);
stick[ed].push_back(stick[st].back()); stick[st].pop_back();
}
else {
int mid = 6 - st - ed;
f(st, mid, value - 1);
f(st, ed, 1);
f(mid, ed, value-1);
}
}
int main()
{
int n;
scanf("%d", &n);
for(int i = n; i>=1;i--)
{
stick[1].push_back(i);
} f(1, 3, n);
}