```
enter code hereclass Stack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self.queue=collections.deque()
def push(self, x):
"""
:type x: int
:rtype: nothing
"""
self.queue.append(x)
def pop(self):
"""
:rtype: nothing
"""
if self.queue and len(self.queue)>1:
for i in range(len(self.queue)-1,0,-1):
self.queue[i]=self.queue[i-1]
self.queue.popleft()
if self.queue and len(self.queue)==1:
self.queue.popleft()
def top(self):
"""
:rtype: int
"""
if len(self.queue)==0:
return None
return self.queue[len(self.queue)-1]
def empty(self):
"""
:rtype: bool
"""
return len(self.queue)==0
```