// Arup Guha
// 2/24/2018
// Towers of Hanoi Solver written for Junior Knights

import java.util.*;

public class towers {

	public static void main(String[] args) {
		printTowers(5, 1, 2);
	}

	// Prints all moves to solve a tower of n disks going from tower start to tower end.
	// start and end from set {1,2,3} and not equal to each other.
	public static void printTowers(int n, int start, int end) {
		if (n > 0) {

			// Calculate other tower.
			int other = 6 - start - end;

			// Move top n-1 disks to other tower.
			printTowers(n-1, start, other);

			// Move our bottom disk.
			System.out.println("Move disk "+n+" from tower "+start+" to tower "+end+".");

			// Move the n-1 disks on top of the bottom disk at our destination.
			printTowers(n-1, other, end);
		}
	}
}