def insert_after(list, new, key):
    """
    Return a list with the new item inserted after the first occurrence
    of the key (if any).
    """
    if list == ():
        return ()
    else:
        head, tail = list
        if head == key:
            return (head, (new, tail))
        else:
            return (head, insert_after(tail, new, key))