import Deque


def arrange(aList):
    arranged = []
    d = Deque.Deque()
    for item in aList:
        if item < 0:
            d.add_rear(item)
        else:
            d.add_front(item)
    while not d.is_empty():
        arranged.append(d.remove_rear())
    return arranged


print(arrange([-3, 12, 6, -7]))
arrange()

dd395cb68109ff51299a37dbd9297e023e4322c3
<mask token>

<mask token>


def arrange(aList):
    arranged = []
    d = Deque.Deque()
    for item in aList:
        if item < 0:
            d.add_rear(item)
        else:
            d.add_front(item)
    while not d.is_empty():
        arranged.append(d.remove_rear())
    return arranged


<mask token>

<mask token>


def arrange(aList):
    arranged = []
    d = Deque.Deque()
    for item in aList:
        if item < 0:
            d.add_rear(item)
        else:
            d.add_front(item)
    while not d.is_empty():
        arranged.append(d.remove_rear())
    return arranged


print(arrange([-3, 12, 6, -7]))
arrange()

import Deque


def arrange(aList):
    arranged = []
    d = Deque.Deque()
    for item in aList:
        if item < 0:
            d.add_rear(item)
        else:
            d.add_front(item)
    while not d.is_empty():
        arranged.append(d.remove_rear())
    return arranged


print(arrange([-3, 12, 6, -7]))
arrange()
