์ง๋ํ๊ธฐ ์๊ฐํ๋ ์๋ฃ๊ตฌ์กฐ ๊ฐ์์์ ๋ฐฐ์ด ๋ด์ฉ์ ์ด์ฉํ์ฌ ์ฝ๋๋ฅผ ์์ฑํด๋ณด์๋ค stack = [] high = -1 def push(num) : global high stack.append(num) high += 1 def top() : if len(stack) == 0 : print(-1) else : print(stack[high]) def userDefPop() : global high if high == -1 : print(-1) else : print(stack.pop()) high -= 1 n = int(input()) for _ in range(n): command = input() if "push" in command : command = command.split() push(command[..