class Q2stacks:
    
    def __init__(self):
        self.stack1=[]
        self.stack2=[]
        
    def enqueue(self,item):
        self.stack1.append(item)
        
    def dequeue(self):
        if not self.stack2:
            while self.stack1:
                self.stack2.append(self.stack1.pop())
        return self.stack2.pop()
            
s=Q2stacks()

s.enqueue(3)
s.enqueue(4)
s.enqueue(5)
s.enqueue(6)

print(s.dequeue())
print(s.dequeue())
            