def hanoi(n,a,b,c):
if n== 1:
print("{}->{}".format(a,c))
else:
hanoi(n-1,a,c,b)
print("{}->{}".format(a,c))
hanoi(n-1,b,a,c)
hanoi(5,'A','B','C')
def hanoi(n,a,b,c):
if n== 1:
print("{}->{}".format(a,c))
else:
hanoi(n-1,a,c,b)
print("{}->{}".format(a,c))
hanoi(n-1,b,a,c)
hanoi(5,'A','B','C')