class Queue :
    def __init__(self):
        self.items = []

    def insert(self, item):
        self.items.insert(0, item)

    def remove(self):
        if self.items == []:
            raise BaseException, "List is empty!"
        return self.items.pop()

    def is_empty(self):
        return (self.items == [])
        
class LinkedList :
    def __init__(self):
        self.items = []

    def addFirst(self, item):
        self.items.insert(0, item)
        
    def append(self, item):
        self.items.append(item)
        
    def removeFront(self):
        if self.items == []:
            raise BaseException, "List is empty!"
        return self.items.pop(0)
        
    def removeEnd(self):
        if self.items == []:
            raise BaseException, "List is empty!"
        return self.items.pop()
        
    def is_empty(self):
        return (self.items == [])