class Stack: def __init__(self): self.x = [] def push(self, item): self.x.append(item) def pop(self): return self.x.pop() class Queue: def __init__(self): self.x = [] def enqueue(self, item): self.x.insert(0, item) def dequeue(self): return self.x.pop()