def merge(sorted1, sorted2):
    """Merge two sorted lists into a single sorted list."""
    if sorted1 == ():
        return sorted2
    elif sorted2 == ():
        return sorted1
    else:
        h1, t1 = sorted1
        h2, t2 = sorted2
        if h1 <= h2:
            return (h1, merge(t1, sorted2))
        else:
            return (h2, merge(sorted1, t2))