N = int(input())
list1 = []
for i in range(N) :
command = input()
if command[0] == 'p' and command[1] == 'u':
a, b, c = command.split()
list1.append(int(b))
elif command[0] =='s' :
print(len(list1))
elif command[0] == 'p' and command[1] == 'o' :
if len(list1) != 0 :
list1.pop()
elif command[0] == 'e' :
if len(list1) != 0 :
print('false')
else :
print('true')
elif command[0] == 't' :
if len(list1) == 0 :
print('-1')
else :
print(list1[-1])
# 특강 떄
w1, w2 = input().split()
print(w1+w2)
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
if a % 2 == 0 :
print('even')
else :
print('odd')
if b % 2 == 0 :
print('even')
else :
print('odd')
if c % 2 == 0 :
print('even')
else :
print('odd')
a, b = input().split()
print(bool(int(a)) and bool(int(b)))
a = int(input())
print(a*2)
a = bool(int(input()))
print(a)
a = bool(int(input()))
print(not a)
a, b = input().split()
a = int(a)
b = int(b)
if a < b :
print(b)
else :
print(a)
a, b = input().split()
a = int(a)
b = int(b)
print(a^b)
a, b = input().split()
a = int(a)
b = int(b)
print(a|b)
a, b = input().split()
a = int(a)
b = int(b)
print(a&b)
a, b = input().split()
a = int(a)
b = int(b)
print(a//b)
a, b = input().split()
a = float(a)
b = float(b)
print(a**b)
a, b = input().split()
a = int(a)
b = int(b)
print(a**b)
w = int(input())
n = input()
print(n * w)
n, w = input().split()
w = int(w)
print(n * w)