"""
A simple implementation of the well-known "Towers of Hanoi" puzzle.

Usage: python hanoi.py <size>
"""
import sys

def move(src, dst, tmp, num):
    if num == 1: print 'Move from', src, 'to', dst
    else:
        move(src, tmp, dst, num-1)
        move(src, dst, tmp, 1)
        move(tmp, dst, src, num-1)

move('left', 'right', 'middle', int(sys.argv[1]))
