def towers_of_hanoi(n):
    """Solution to exercise C-4.14.

    In the Towers of Hanoi puzzle, we are given a platform with three pegs, a,
    b, and c, sticking out of it. On peg a is a stack of n disks, each larger
    than the next, so that the smallest is on the top and the largest is on the
    bottom.  The puzzle is to move all the disks from peg a to peg c, moving
    one disk at a time, so that we never place a larger disk on top of a
    smaller one.
    See Figure 4.15 for an example of the case n = 4. Describe a recursive
    algorithm for solving the Towers of Hanoi puzzle for arbitrary n.
    """
    a = list(range(n, 0, -1))
    b = []
    c = []

    def recurse(n, source, destination, temp):
        if n > 0:  # Base case, bottom of stack of disks
            # Move n-1 disks from source to temporary storage
            recurse(n-1, source, temp, destination)
            # Move the nth (bottom) disk from source to destination
            destination.append(source.pop())
            # Move the n-1 disks from temporary storage to destination
            recurse(n-1, temp, destination, source)
    recurse(n, a, c, b)
    return c