# -*- coding:utf-8 -*-
class Solution:
    def __init__(self):
        self.stack1 = []
        self.stack2 = []
    def push(self, node):
        # write code here
        self.stack1.append(node)
        
    def pop(self):
        # return xx
        if self.stack2 == []:
            while self.stack1 != []:
                self.stack2.append(self.stack1.pop())
            return self.stack2.pop()
        else:
            return self.stack2.pop()
        # return self.stack2.pop()
        # return self.stack1.pop(0) # list.pop(k)时间复杂度是O(n),list.pop()是O(1)