class TowersOfHanoi { public static void move(int N, char src, char destn, char intermediate) { if(N == 1) { System.out.println(" Move "+src+" to " +destn); return; } move(N-1, src, intermediate, destn); System.out.println(" Move "+src+" to "+destn); move(N-1, intermediate, destn, src); } // End move() public static void main(String[] args) { int N = Integer.parseInt(args[0]); move(N, 'A', 'C', 'B'); } // End main() } // End class TowersOfHanoi