import java.util.*;
public class Main {
static int towerOfHanoi(int n, String src, String dest, String helper, int count) {
if (n == 0) {
return 0;
}
// step : 1
towerOfHanoi(n - 1, src, helper, dest, count++);
// step : 2
System.out.println("Move " + n + "th disc from " + src + " to " + dest);
count++;
// step : 3
towerOfHanoi(n - 1, helper, dest, src, count++);
return count;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int count = 0;
System.out.println(towerOfHanoi(n, "T1", "T2", "T3", 0));
}
}