#include <stdio.h>
void hanoi(int height, int start, int finish)
{
if (height == 1) {
printf("%d %d\n", start, finish);
} else {
int tmp = 6 - start - finish;
hanoi(height - 1, start, tmp);
printf("%d %d\n", start, finish);
hanoi(height - 1, tmp, finish);
}
}
int main()
{
int k;
scanf("%d",k);
hanoi(k,1,2);
return 0;
}
int tmp = start ^ finish;
int tmp = start ^ finish;
hanoi( height - 1, start, tmp );
hanoi( 1, start, finish );
hanoi( height - 1, tmp, finish );