/*
import java.util.*;
class dbLinkedList{
class Node<E>{
private E data;
private Node<E> header;
private Node<E> tail;
private Node<E> prev;
private Node<E> next;
private Node<E> crnt;
public Node() {
header.next = tail;
tail = null;
crnt = header;
}
public void add(int x) {
Node v = new Node<E>();
v.data = x;
v.prev = crnt;
v.next = crnt.next;
crnt = v;
}
}
MemoryManager manager = new MemoryManager(1000);
manager.malloc(500);
}
class MemoryManager {
private int capacity;
public MemoryManager(int x) {
this.capacity = x;
}
public class Node<E>{
private Node<E> data;
private Node<E> next;
private Node<E> prev;
private Node<E> crnt;
private Node<E> header;
private Node<E> tail;
public Node(){
header.next = tail;
header.prev = null;
tail = null;
crnt = header;
}
}
}
// Node 구조 (item, prev, next)
public class Main{
public Main() {
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
class GCTimeCheck{
public void time(){
long startTime = System.nanoTime();
long endTime = System.nanoTime();
System.out.println(endTime - startTime + "ns");
}
}
*/
/*
import java.util.*;
public class Main{
public Main() {
Scanner scan = new Scanner(System.in);
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import java.util.*;
class factorial{
private int sum = 1;
private int x = 0;
public factorial(int x) {
this.x= x;
}
public void fac() {
if(x!=1) {
sum *= x;
x--;
this.fac();
}
else {
System.out.println(sum);
}
}
}
public class Main{
public Main() {
Scanner s = new Scanner(System.in);
int x = s.nextInt();
factorial f = new factorial(x);
f.fac();
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import java.util.*;
class c{
private int x, y;
private int z=1;
public c(int x, int y) {
this.x=x;
this.y=y;
}
public void k(){
if(x%z==0&&y%z==0&&z!=1) {
System.out.println(z);
}else {
z++;
}
}
}
public class Main{
public Main() {
Scanner s = new Scanner(System.in);
int x = s.nextInt();
int y = s.nextInt();
c c = new c(x,y);
c.k();
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import java.util.*;
class hanoi{
private int x;
private int y;
private int z;
public hanoi(int x, int y, int z){
this.x=x; //
this.y=y;
this.z=z;
}
public void move() {
}
}
public class Main{
public Main() {
Scanner s= new Scanner(System.in);
int x = s.nextInt();
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import java.util.*;
public class Main{
public Main() {
int ptr=0;
int count= 0;
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int[] arr = new int[n];
for(int i=0; i<n; i++) {
int k = s.nextInt();
if(k==0&&i!=0) {
count++;
}else{
if(k==0)
count ++;
arr[ptr++] = k;
}
}
for(int i=0; i<count; i++) {
System.out.println(arr[i]);
}
}
public static void main(String[] args) {
new Main();
}
}
*/
import java.util.*;
class hanoi{
private int x=1;
private int y=0;
private int z;
public hanoi(int x, int y, int z){
this.x = x;
this.y= y;
this.z= z;
}
public void move(int y, int z) {
z=y-1;
if(z<0) {
System.out.println(y+" to "+z);
z=2;
this.move(y,z);
}else {
System.out.println(y+" to "+z);
this.move(y, z);
}
}
}
public class Main{
public Main() {
Scanner s = new Scanner(System.in);
int n = s.nextInt(); //원반 개수
hanoi h = new hanoi(n,n,n);
h.move();
}
public static void main(String[] args) {
new Main();
}
}