public class Towers { public static void main(String[] args) { Solve(4, 1, 2, 3); } public static void Solve(int n, int Src, int Aux, int Dst) { if (n == 0) return; else { Solve(n-1, Src, Dst, Aux); System.out.println("Move " + Src + " to " + Dst); Solve(n-1, Aux, Src, Dst); } } }