def partition(seq):
    """
    pick the first element in seq as the pivot
    elements <= pivot goes to the left
    elements > pivot goest to the right
    return the left, pivot, right
    """
    pivot, seq = seq[0], seq[1:] 
    low = [x for x in seq if x <= pivot]
    high = [x for x in seq if x > pivot]
    return low, pivot, high