
public class Towers {

	public static void main(String[] args) {
		towers(3, 1, 3, 2);
	}
	
	public static void towers(int n, int from, int to, int using) {
		if( n == 1) {
			System.out.printf("Move a disk from %d to %d\n", from, to);
		}
		else {
			//recursive case
			//move n-1 disks from -> using
			towers(n-1, from, using, to);
			
			//move 1 disk from->to
			towers(1, from, to, using);
			
			//move n-1 disks using -> to
			towers(n-1, using, to, from);
		}
	}

}
