class Node():
    def __init__(self,data):
        self.data = data
        self.next = None

class Quene():
    def __init__(self):
        self.front = None
        self.rear = None

    def isEmpty(self):
        return self.front == None

    #  dodanie do kolejki
    def EnQuenue(self,item):
        new = Node(item)

        if self.rear == None:
            self.front = self.rear = new
            return
        self.rear.next = new
        self.rear = new

    def DeQueue(self):

        if self.isEmpty():
            return
        temp = self.front
        self.front = temp.next

        if self.front == None:
            self.rear = None

    def print_queue(self):
        if self.front == None:
            print('lista jest pusta')
        else:
            tmp = self.front
            while tmp:
                print(tmp.data)
                tmp = tmp.next

q = Quene()
q.EnQuenue(10)
q.EnQuenue(20)
q.EnQuenue(56)
q.EnQuenue(40)
q.EnQuenue(17)
q.DeQueue()
print('Queue front ' + str(q.front.data))
print('Queue rear ' + str(q.rear.data))


8410d0ef0f68577c08da4c5f011aab9600f616a3
<mask token>


class Quene:
    <mask token>

    def isEmpty(self):
        return self.front == None

    def EnQuenue(self, item):
        new = Node(item)
        if self.rear == None:
            self.front = self.rear = new
            return
        self.rear.next = new
        self.rear = new

    def DeQueue(self):
        if self.isEmpty():
            return
        temp = self.front
        self.front = temp.next
        if self.front == None:
            self.rear = None

    def print_queue(self):
        if self.front == None:
            print('lista jest pusta')
        else:
            tmp = self.front
            while tmp:
                print(tmp.data)
                tmp = tmp.next


<mask token>

<mask token>


class Quene:

    def __init__(self):
        self.front = None
        self.rear = None

    def isEmpty(self):
        return self.front == None

    def EnQuenue(self, item):
        new = Node(item)
        if self.rear == None:
            self.front = self.rear = new
            return
        self.rear.next = new
        self.rear = new

    def DeQueue(self):
        if self.isEmpty():
            return
        temp = self.front
        self.front = temp.next
        if self.front == None:
            self.rear = None

    def print_queue(self):
        if self.front == None:
            print('lista jest pusta')
        else:
            tmp = self.front
            while tmp:
                print(tmp.data)
                tmp = tmp.next


<mask token>

class Node:

    def __init__(self, data):
        self.data = data
        self.next = None


class Quene:

    def __init__(self):
        self.front = None
        self.rear = None

    def isEmpty(self):
        return self.front == None

    def EnQuenue(self, item):
        new = Node(item)
        if self.rear == None:
            self.front = self.rear = new
            return
        self.rear.next = new
        self.rear = new

    def DeQueue(self):
        if self.isEmpty():
            return
        temp = self.front
        self.front = temp.next
        if self.front == None:
            self.rear = None

    def print_queue(self):
        if self.front == None:
            print('lista jest pusta')
        else:
            tmp = self.front
            while tmp:
                print(tmp.data)
                tmp = tmp.next


<mask token>

class Node:

    def __init__(self, data):
        self.data = data
        self.next = None


class Quene:

    def __init__(self):
        self.front = None
        self.rear = None

    def isEmpty(self):
        return self.front == None

    def EnQuenue(self, item):
        new = Node(item)
        if self.rear == None:
            self.front = self.rear = new
            return
        self.rear.next = new
        self.rear = new

    def DeQueue(self):
        if self.isEmpty():
            return
        temp = self.front
        self.front = temp.next
        if self.front == None:
            self.rear = None

    def print_queue(self):
        if self.front == None:
            print('lista jest pusta')
        else:
            tmp = self.front
            while tmp:
                print(tmp.data)
                tmp = tmp.next


<mask token>
q.EnQuenue(10)
q.EnQuenue(20)
q.EnQuenue(56)
q.EnQuenue(40)
q.EnQuenue(17)
q.DeQueue()
print('Queue front ' + str(q.front.data))
print('Queue rear ' + str(q.rear.data))

class Node():
    def __init__(self,data):
        self.data = data
        self.next = None

class Quene():
    def __init__(self):
        self.front = None
        self.rear = None

    def isEmpty(self):
        return self.front == None

    #  dodanie do kolejki
    def EnQuenue(self,item):
        new = Node(item)

        if self.rear == None:
            self.front = self.rear = new
            return
        self.rear.next = new
        self.rear = new

    def DeQueue(self):

        if self.isEmpty():
            return
        temp = self.front
        self.front = temp.next

        if self.front == None:
            self.rear = None

    def print_queue(self):
        if self.front == None:
            print('lista jest pusta')
        else:
            tmp = self.front
            while tmp:
                print(tmp.data)
                tmp = tmp.next

q = Quene()
q.EnQuenue(10)
q.EnQuenue(20)
q.EnQuenue(56)
q.EnQuenue(40)
q.EnQuenue(17)
q.DeQueue()
print('Queue front ' + str(q.front.data))
print('Queue rear ' + str(q.rear.data))

