# see the description about the Towers of Hanoi in your textbook

def hanoi(height, frompeg, topeg, withpeg):
    if height >= 1:
        hanoi(height-1, frompeg, withpeg, topeg)
        printmove(frompeg, topeg)
        hanoi(height-1, withpeg, topeg, frompeg)
        
def printmove(frompeg, topeg):
    print "move disc from "+str(frompeg)+" to "+str(topeg)

hanoi(5, "A", "C", "B")
    