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

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

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

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

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

q=Queue()
q.enQueue(10)
q.enQueue(20)
q.enQueue(30)
q.enQueue(40)
q.deQueue()
q.deQueue()
q.enQueue(50)
q.enQueue(60)
q.deQueue()
q.deQueue()
q.deQueue()
q.deQueue()
print("Queue front",q.front.data)
print("Queue rear",q.rear.data)
