
public class TowerOfHanou {

	public static void TOH(int n,char A,char B,char C){
		if(n==1){
			move(A,B);
		}
		else{
			TOH(n-1,A,C,B);
			move(A,B);
			TOH(n-1,C,B,A);
		}
		
	}
	public static void move(char A,char B){
		System.out.println(A+"->"+B);
	}
	
	public static void main(String[] args) {
		TOH(3,'A','B','C');
	}

}
