Problem:
Vector For a dynamic array $A = \{a_0, a_1, ...\}$ of integers, perform a sequence of the following operations:  pushBack($x$): add element $x$ at the end of $A$  randomAccess($p$):print element $a_p$  popBack(): delete the last element of $A$  $A$ is a 0-origin array and it is empty in the initial state. Input The input is given in the following format. $q$
$query_1$
$query_2$
:
$query_q$ Each query $query_i$ is given by 0 $x$ or 1 $p$ or 2 where the first digits 0 , 1 and 2 represent pushBack, randomAccess and popBack operations respectively. randomAccess and popBack operations will not be given for an empty array. Output For each randomAccess, print $a_p$ in a line. Constraints  $1 \leq q \leq 200,000$  $0 \leq p < $ the size of $A$  $-1,000,000,000 \leq x \leq 1,000,000,000$  Sample Input 1 8
0 1
0 2
0 3
2
0 4
1 0
1 1
1 2 Sample Output 1 1
2
4

Solution (Python):
n = int(input())
commands = [input().split() for i in range(n)]
a = []
for command in commands:
    if len(command) == 2:
        if command[0] == '0':
            a.append(int(command[1]))
        elif command[0] == '1':
            print(int(a[int(command[1])]))
    else:
        a.pop(len(a) - 1)

Solution (Python):


from collections import deque

n = int(input())
word = deque()

for i in range(n):
    command = list(map(int, input().split()))
    if command[0] == 0:
        word.append(command[1])
    elif command[0] == 1:
        print('{0}'.format(word[command[1]]))
    elif command[0] == 2:
        word.pop()

Solution (Python):
line_num = int(input())
array = []
for i in range(line_num):
    line = [int(i) for i in input().split()]
    if line[0] == 0:
        array.append(line[1])
    elif line[0] == 2:
        array.pop()
    else:
        print(array[line[1]])

Solution (Python):
n = int(input())
a = []
for i in range(n):
    order = input().split()
    if order[0] == '0':
        a.append(int(order[1]))
    elif order[0] == '1':
        print(a[int(order[1])])
    elif order[0] == '2':
        a.pop()

Solution (Python):
from sys import stdin
from collections import deque

num = int(input())

q = deque()

for i in range(num):

	cmd = stdin.readline().strip().split()

	if cmd[0] == "0":
		
		q.append(cmd[1])

	elif cmd[0] == "1":
		
		print(q[int(cmd[1])],sep='\n')
	else:
		
		q.pop()

Solution (Python):
cnt = int(input())
a = []
for i in range(cnt):
    li = list(map(int,input().split()))
    if li[0] == 0:
        a.append(li[1])
    elif li[0] ==1:
        print(a[li[1]])
    else:
        a.pop(-1)

Solution (Python):

"""
Created on Sat May 19 14:55:45 2018
AOJ ITP2_1_A  
@author: maezawa
"""

q = int(input())
a = []

for i in range(q):
    ops= list(map(int,input().split()))
    if ops[0] == 0:
        a.append(ops[1])
    elif ops[0] == 1:
        print(a[ops[1]])
    else:
        a.pop(-1)

Solution (Python):
stack = []

q = int(input())
for i in range(q):
    op = list(map(int, input().split(' ')))
    if op[0] == 0:
        stack.append(op[1])
    elif op[0] == 1:
        print(stack[op[1]])
    elif op[0] == 2:
        stack.pop()

Solution (Python):

from collections import UserList


class Vector(UserList):
    def push_back(self, v):
        self.data.append(v)

    def pop_back(self):
        return self.data.pop()


def run():
    vec = Vector()
    count = int(input())

    for i in range(count):
        com, *val = [int(x) for x in input().split()]
        if com == 0:
            vec.push_back(val[0])
        elif com == 1:
            print(vec[val[0]])
        elif com == 2:
            vec.pop_back()
        else:
            ValueError('invalid command')


if __name__ == '__main__':
    run()

Solution (Python):
arr = []
q = int(input())

for _ in range(q):
    cmd = input().split()
    cmdNum = int(cmd[0])
    if cmdNum == 0:
        arr.append(int(cmd[1]))
    elif cmdNum == 1:
        print(arr[int(cmd[1])])
    else:
        arr.pop()

Solution (Python):



class Vector(object):
    def __init__(self):
        self.A = list()

    def pushBack(self, x):
        self.A.append(x)

    def randomAccess(self, p):
        print self.A[p]

    def popBack(self):
        del self.A[-1]

A = Vector()
q = int(raw_input())
for i in range(q):
    line = [int(i) for i in raw_input().split()]
    if line[0] == 0:
        A.pushBack(line[1])
    elif line[0] == 1:
        A.randomAccess(line[1])
    else:
        A.popBack()

Solution (Python):
stack = []
 
q = int(input())
for i in range(q):
    op = list(map(int, input().split(' ')))
    if op[0] == 0:
        stack.append(op[1])
    elif op[0] == 1:
        print(stack[op[1]])
    elif op[0] == 2:
        stack.pop()

Solution (Python):
def pushBack(lists, x):
    return lists.insert(len(lists), x)

def randomAccess(lists, p):
    print(lists[p])

def popBack(lists):
    return lists.pop(len(lists) - 1)

if __name__ == '__main__':
    l = list()
    n = int(input())
    for i in range(n):
        j= input().split()

        if int(j[0]) == 0:
            pushBack(l, int(j[1]))
        elif int(j[0]) == 1:
            randomAccess(l, int(j[1]))
        else:
            popBack(l)

Solution (Python):


N = int(input())
A = []
for i in range(N):
    query = list(map(int, input().split()))
    if query[0] == 0:
        A.append(query[1])
    elif query[0] == 1:
        print(A[query[1]])
    elif query[0] == 2:
        A.pop()

Solution (Python):
import sys

def decodes(x):
	temp = []
	for i in range(len(x)):
		if x[i][0] == 0:
			temp.append(x[i][1])
		elif x[i][0] == 1:
			print(temp[x[i][1]])
		elif x[i][0] == 2:
			temp = temp[:len(temp) - 1]

l = []
for i in sys.stdin:
	l.append(i.split())

for i in range(len(l)):
	for j in range(len(l[i])):
		l[i][j] = int(l[i][j])

decodes(l)

Solution (Python):



from collections import deque
Q = deque()
q = int(input())
for i in range(q):
	a = input()
	if a[0] == '2': Q.pop()      
	else:
		id, v = map(int, a.split())
		if id == 0: Q.append(v)  
		else: print(Q[v])

Solution (Python):



from collections import deque
Q = deque()
q = int(input())
for i in range(q):
	a = input()
	if   a[0] == '0': Q.append(a[2:])      
	elif a[0] == '1': print(Q[int(a[2:])]) 
	else:             Q.pop()

Solution (Python):

"""
Created on Sun Jun 24 14:53:50 2018
ITP21A
@author: maezawa
"""

from collections import deque

d = deque()

n = int(input())

for i in range(n):
    c = list(map(int, input().split()))
    if c[0] == 0:
        d.append(c[1])
    elif c[0] == 1:
        print(d[c[1]])
    else:
        d.pop()

Solution (Python):
q=int(input())
A=[]
for i in range(q):
    s=input()
    if s[0]=="0":
        a,b=map(int,s.split())
        A.append(b)
    if s[0]=="1":
        a,b=map(int,s.split())
        print(A[b])
    if s[0]=="2":
        A=A[:-1]

Solution (Python):
n=int(input())
s=[]
for i in range(n):
    a=list(map(int,input().split()))
    b=len(a)
    if b==2:
        if a[0]==0:
            s.append(a[1])
        else:
            print(s[a[1]])
    else:
        s.pop()

Solution (Python):



from collections import deque
Q = deque()
q = int(input())
for i in range(q):
    a = input()
    if   a[0] == '0': Q.append(a[2:])      
    elif a[0] == '1': print(Q[int(a[2:])]) 
    else:             Q.pop()

Solution (Python):
def pushBack(x):
	A.append(x)


def randomAccess(p):
	print(A[p])


def popBack():
	A.pop()


q = int(input())
A = []
for _ in range(q):
	tmp = input()
	if tmp=='2':
		popBack()
	else:
		a, b = map(int, tmp.split())
		if a==0:
			pushBack(b)
		else:
			randomAccess(b)

Solution (Python):
A = []
n = int(input())
for i in range(n):
    tmp = input().split()
    if tmp[0] == "2":
        A.pop()
    else:
        if tmp[0] == "0":
            A.append(tmp[1])
        else:
            print(A[int(tmp[1])])

Solution (Python):
q = int(input())
A = []
ans = []
for i in range(q):
    q = str(input())
    if q[0] == "0": 
        A.append(int(q[2:]))
    elif q[0] == "1": 
        
        print(A[int(q[2:])])
    else: 
        A.pop()

Solution (Python):
A = []
ans = []


def pushBack(x):
    A.append(x)


def randomAccess(p):
    if A != []:
        ans.append(A[p])
    else:
        print('RandAccError')


def popBack():
    if A != []:
        del A[-1]
    else:
        print('DelError')


def main():
    q = input()
    for i in range(int(q)):
        try:
            query, number = (int(x) for x in input().split())
        except ValueError:
            popBack()
            continue

        if query == 0:
            pushBack(number)
        elif query == 1:
            randomAccess(number)

    for i in range(len(ans)):
        print(ans[i])


if __name__ == "__main__":
    main()

Solution (Python):

def pushBack(a, x):
    a.append(x)
def randomAccess(a, p):
    print(a[p])
def popBack(a):
    a = a[:-1]
    return a
q = int(input())
a = []
for _ in range(q):
    b = list(map(int, input().split()))
    if b[0] == 0:
        pushBack(a, b[1])
    elif b[0] == 1:
        randomAccess(a, b[1])
    else:
        a = popBack(a)

Solution (Python):
import sys

A = []

Q = int(sys.stdin.readline().rstrip())
for _ in range(Q):
    s = sys.stdin.readline().rstrip().split()
    if s[0] == "0":  
        A.append(s[1])
    elif s[0] == "1":  
        print(A[int(s[1])])
    else:
        A.pop()

Solution (Python):
class vector:
    data = []

    def pashBack(self, x):
        self.data.append(x)

    def randomAccess(self, p):
        return self.data[p]

    def popBack(self):
        deta_index = len(self.data)-1
        del self.data[deta_index]


q = int(input())
v = vector()

for i in range(q):
    order = input().split()

    if order[0] == "0":
        x = int(order[1])
        v.pashBack(x)

    elif order[0] == "1":
        x = int(order[1])
        data = v.randomAccess(x)
        print(data)

    elif order[0] == "2":
        v.popBack()

Solution (Python):
import sys
N = int(input())
a = []
for i in range(N):
  line = sys.stdin.readline().split()
  if int(line[0]) == 0:
    a.append(int(line[1]))
  elif int(line[0]) == 1:
    print(a[int(line[1])])
  elif  int(line[0]) == 2:
    a.pop()

Solution (Python):
def resolve():
    from collections import deque
    q = int(input())
    ans = deque()
    for _ in range(q):
        q = [int(i) for i in input().split()]
        if q[0] == 2:
            ans.pop()
        else:
            x = q[1]
            if q[0] == 0:
                ans.append(x)
            else:
                print(ans[x])


resolve()

Solution (Python):
N = int(input())
A = []

for _ in range(N):
    order = list(map(int,input().split()))
    if order[0] == 0:
        A.append(order[1])
    elif order[0] == 1:
        print(A[order[1]])
    else:
        del A[-1]

Solution (Python):
A = []
n = int(input())
for i in range(n):
    q = input()
    if q[0] == "0":
        A.append(q[2:])
    elif q[0] == "1":
        print(A[int(q[2:])])
    else:
        del A[-1]

Solution (Python):
q=int(input())
lis=[]
lq=[]
for i in range(q):
	lq.append([int(x) for x in input().split(' ')])

for i in lq:
	order=i[0]
	if order==0:
		lis.append(i[1])
	elif order==1:
		print(lis[i[1]])
	elif order==2:
		lis.pop(-1)

Solution (Python):
from collections import deque
Q = deque()
q = int(input())
for i in range(q):
	a = input()
	if   a[0] == '0': Q.append(a[2:])      
	elif a[0] == '1': print(Q[int(a[2:])]) 
	else:             Q.pop()

Solution (Python):
class Vector:
    def __init__(self):
        self.vec = []
    
    def push_back(self,x):
        self.vec.append(x)
    
    def random_access(self,p):
        return self.vec[p]

    def pop_back(self):
        self.vec.pop()

my_vec = Vector()

n = int(input())
for _ in range(n):
    args = input().split(' ')
    ope = args[0]
    if ope == '0':
        my_vec.push_back(int(args[1]))
    elif ope == '1':
        print(my_vec.random_access(int(args[1])))
    elif ope == '2':
        my_vec.pop_back()

Solution (Python):
Q = int(input())
stack = []
for _ in range(Q):
    query = list(map(int,input().split()))
    if query[0] == 0:
        stack.append(query[1])
    elif query[0] == 1:
        print(stack[query[1]])
    else:
        stack.pop()

Solution (Python):
n = int(input())
s = []
for i in range(n):
    order = list(map(int,input().split()))
    if order[0] == 0:
        s.append(order[1])
    elif order[0] == 1:
        print(s[order[1]])
    elif order[0] == 2:
        s.pop()

Solution (Python):
num = int(input())

A=[]

for i in range(num):
    queryi = list(map(int, input().split()))
    if queryi[0] == 0:
        A.append(queryi[1])
    elif queryi[0] == 1:
        print(A[queryi[1]])
    elif queryi[0] == 2:
        A.pop(-1)
    else:
        print("error")

Solution (Python):
def pushBack(vec,x):
    vec.append(x)
    return vec

def randomAccess(vec, p):
    return vec[p]

def popBack(vec):
    vec= vec[0:len(vec)-1]    
    return vec

n = int(input())
num_list = []
for i in range(n):
    num_list.append(list(map(int,input().split())))

num_of_operations = num_list[0][0]
vec = []
for i in range(len(num_list)):
    operation = num_list[i][0]
    if(operation == 2):
        vec = popBack(vec)
    else:
        n = num_list[i][1]
        
        if(operation == 0):
            vec = pushBack(vec,n)

        if(operation == 1):
            value = randomAccess(vec,n)
            print(value)

Solution (Python):
q = int(input())
A = []
for i in range(q):
    query = input().split()
    if query[0] == '0':
        A.append(query[1])
    elif query[0] == '1':
        print(A[int(query[1])])
    elif query[0] == '2':
        A.pop()

Solution (Python):

str_list = []


for _ in range(int(input())):
    
    
    try:
        a,b = map(int,input().split())
        if a == 0:str_list.append(b)
        elif a == 1:print(str_list[b])
        
    
    except ValueError:
        str_list.pop(-1)

Solution (Python):
q = int(input())
A = []

for i in range(q):
    Q, *x = (int(x) for x in input().split())
    x = x[0] if x else None
    if Q == 0:
        A.append(x)
    elif Q == 1:
        print(A[x])
    else:
        del A[-1]

Solution (Python):

from sys import stdin
from collections import deque

n = int(input())
deq = deque()
for i in range(n):
    q = list(stdin.readline().split())
    if q[0] == '0':
        deq.append(q[1])
    elif q[0] == '1':
        print(deq[int(q[1])])
    else:
        deq.pop()

Solution (Python):
A = list()


def pushBack(x):
  A.append(x)


def randomAccess(x):
  print(A[x])
  

def popBack():
  A.pop()


cmdList = [ pushBack, randomAccess, popBack ]
n = int(input())

for i in range(n):
  cmd = input()
  if cmd.startswith("0"):
    c,param = map(int,cmd.split(" "))
    cmdList[0](param)
  if cmd.startswith("1"):
    c,param = map(int,cmd.split(" "))
    cmdList[1](param)
  if cmd.startswith("2"):
    cmdList[2]()

Solution (Python):
q = int(input())
querys = [list(map(int, input().split())) for _ in range(q)]

stack = []
for query in querys:
    if query[0] == 0:
        stack.append(query[1])

    if query[0] == 1:
        print(stack[query[1]])

    if query[0] == 2:
        stack.pop()

Solution (Python):
def pushBack(A, x):
    A.append(x)
def randomAccess(A, x):
    return A[x]
def popBack(A):
    _=A.pop()


A = []
q = int(input())
for _ in range(q):
    query = input()
    if query == '2':
        popBack(A)
    else:
        query = list(map(int, query.split()))
        if query[0] == 0:
            pushBack(A, query[1])
        elif query[0] == 1:
            print(randomAccess(A, query[1]))

Solution (Python):
q = int(input())
A = []
for _ in range(q):
    tmp = [int(i) for i in input().split()]
    if tmp[0] == 0:
        A.append(tmp[1])
    if tmp[0] == 1:
        print(A[tmp[1]])
    if tmp[0] == 2:
        A.pop()

Solution (Python):
from collections import deque

q = int(input())

que = deque()
for i in range(q):
    query = input().split()

    if query[0] == "0":
        que.append(query[1])
    elif query[0] == "1":
        print(que[int(query[1])])
    else:
        que.pop()

Solution (Python):
lst=[]
n = int(input())
for i in range(n) :
    ope = list(map(int, input().split()))
    if ope[0] == 0 :
        lst.append(ope[1])
    elif ope[0] == 1 :
        print(lst[ope[1]])
    elif ope[0] == 2 :
        del lst[-1]

Solution (Python):
q = int(input())
data_list = list()
for i in range(q):
    data = input()
    data_list.append(data)

a = list()
for data in data_list:
    if data[0] == "0":
        a.append(data.split()[1])
    elif data[0] == "1":
        print(a[int(data.split()[1])])
    else:
        a.pop(-1)

Solution (Python):
q = int(input())
l = []
while q > 0:
    q -= 1
    s = input().split()
    if s[0] == '0':
        l.append(s[1])
    elif s[0] == '1':
        print(l[int(s[1])])
    else:
        l.pop()

Solution (Python):
l=[]
n=int(input())
for i in range(n):
    q=list(map(int,input().split()))
    if q[0]==0:
        l.append(q[1])
    elif q[0]==1:
        print(l[q[1]])
    else:
        del l[-1]

Solution (Python):
from collections import deque
Q = deque()
q = int(input())
for i in range(q):
    a = input().split()
    if a[0] == "0":Q.append(a[1])
    elif a[0] == "1": print(Q[int(a[1])])
    else: Q.pop()

Solution (Python):
q = int(input())
A = []
for i in range(q):
    a, *x = (int(x) for x in input().split())
    if a == 0:
        A.append(x[0])
    elif a == 1:
        print(A[int(x[0])])
    else:
        del A[-1]

Solution (Python):
q = int(input())
A = []
for i in range(q):
    query = [int(i) for i in input().split()]
    if query[0] == 0:
        A.append(query[1])
    elif query[0] == 1:
        print(A[query[1]])
    elif query[0] == 2:
        A.pop(len(A)-1)

Solution (Python):
N = int(input())

num_list = []

def pushback(x):
    num_list.append(x)
    
def randomAccess(p):
    print(num_list[p])
    
def popBack():
    num_list.pop()
    
for i in range(N):
    input_num = input().split()
    if input_num[0] == "0":
        pushback(input_num[1])
    elif input_num[0] == "1":
        randomAccess(int(input_num[1]))
    else:
        popBack()

Solution (Python):
d = []
n = int(input())
for _ in range(n):
    q = list(map(int,input().split()))
    if q[0] == 0:
        d.append(int(q[1]))
    if q[0] == 1:
        print (d[int(q[1])])
    if q[0] == 2:
        d.pop()

Solution (Python):
a=[]
for _ in range(int(input())):
    ar=list(map(int,input().split()))
    if len(ar)==1: x,=ar
    else: x,y=ar
    if x==0:
        a.append(y)
    if x==1:
        print(a[y])
    if x==2:
        a.pop()

Solution (Python):
n = int(input())
ans = []


for i in range(n):
    m = list(map(int,input().split()))
    if m[0] == 0:
        ans.append(m[1])
    elif m[0] == 1:
        print(ans[m[1]])
    
    elif m[0] == 2:
        ans.pop()

Solution (Python):
num=int(input())
A=[]
for i in range(num):
    lst=list(map(int,input().split()))
    if lst[0]==0:
        A.append(lst[1])
        
    elif lst[0]==1:
        print(A[lst[1]])
        
    elif lst[0]==2:
        del A[-1]

Solution (Python):
import itertools

def spaced_to_ints(spaced_some):
    return [int(a) for a in spaced_some.split(" ")]

def order_sequence_chars(str):
    return list(str)
def count_order(order):
    return(int(order))

def get_dice():
    input_data = input().split(" ")
    items = [int(cont) for cont in input_data]
    keys = ['T', 'S', 'E', 'W', 'N', 'B']
    return dict(zip(keys, items))

def rot_dice(rot, dice):
    if rot == "N":
        keys = ['T', 'S', 'B', 'N']
        items = dice['S'], dice['B'], dice['N'], dice['T']
        new_dice = dict(zip(keys, items))
        dice.update(new_dice)

    if rot == "S":
        keys = ['T', 'S', 'B', 'N']
        items = dice['N'], dice['T'], dice['S'], dice['B']
        new_dice = dict(zip(keys, items))
        dice.update(new_dice)

    if rot == "E":
        keys = ['T', 'E', 'B', 'W']
        items = dice['W'], dice['T'], dice['E'], dice['B']
        new_dice = dict(zip(keys, items))
        dice.update(new_dice)

    if rot == "W":
        keys = ['T', 'E', 'B', 'W']
        items = dice['E'], dice['B'], dice['W'], dice['T']
        new_dice = dict(zip(keys, items))
        dice.update(new_dice)

    if rot == "R":
        keys = ['N', 'W', 'S', 'E']
        items = dice['E'], dice['N'], dice['W'], dice['S']
        new_dice = dict(zip(keys, items))
        dice.update(new_dice)

    if rot == "L":
        keys = ['N', 'W', 'S', 'E']
        items = dice['W'], dice['S'], dice['E'], dice['N']
        new_dice = dict(zip(keys, items))
        dice.update(new_dice)

def search_right_surf(conds, dice):
    a, b = conds
    a_key = [k for k, v in dice.items() if v == a]
    b_key = [k for k, v in dice.items() if v == b]
    key_list = a_key + b_key

    part_st = ''.join(key_list)

    def search(part_st):
        if part_st in "TNBST":
            return "W"

        if part_st in "TSBNT":
            return "E"

        if part_st in "TEBWT":
            return "N"

        if part_st in "TWBET":
            return "S"

        if part_st in "NESWN":
            return "B"

        if part_st in "NWSEN":
            return "T"

    target_key = search(part_st)
    print(dice[target_key])

def search_top_surf(top_surf, dice):

    dice2_surf, *_ = [k for k, v in dice.items() if v == top_surf]

    if dice2_surf == 'N':
        rot_dice("S", dice)

    if dice2_surf == 'B':
        controls = list("SS")
        for i in controls:
            rot_dice(i, dice)
    if dice2_surf == 'S':
        controls = list("N")
        for i in controls:
            rot_dice(i, dice)
    if dice2_surf == 'W':
        controls = list("E")
        for i in controls:
            rot_dice(i, dice)
    if dice2_surf == 'E':
        controls = list("W")
        for i in controls:
            rot_dice(i, dice)

def search_flont_surf(flont_surf, dice):

    dice2_surf, *_ = [k for k, v in dice.items() if v == flont_surf]

    if dice2_surf == 'E':
        controls = list("R")
        for i in controls:
            rot_dice(i, dice)

    if dice2_surf == 'S':
        controls = list("RR")
        for i in controls:
            rot_dice(i, dice)

    if dice2_surf == 'W':
        rot_dice("L", dice)

def rot_compare(dice1, dice2):

    def compare_dice(dice1, dice2):
        if dice1 == dice2:
            return True

    comb = ["N", "S", "E", "W", "R", "L"]
    tups = list()
    for i in range(6):
        tups.append(itertools.combinations(comb, i))

    if compare_dice(dice1, dice2):
        return True

    for commands in itertools.chain.from_iterable(tups):
        for command in commands:
            rot_dice(command, dice2)
            if compare_dice(dice1, dice2):
                return True
    return False

def compare_many_dices(dice_list):
    dice1 = dice_list.pop(0)
    for dice2 in dice_list:
        if rot_compare(dice1, dice2):
            return True
    return False

def q1():

    dice = get_dice()
    controls = list(input())
    for i in controls:
        rot_dice(i, dice)
    print(dice["T"])

def q2():

    dice = get_dice()
    a = input()
    repeater = int(a)

    for neee in range(repeater):
        control_input = input().split(" ")
        conds = [int(i) for i in control_input]
        search_right_surf(conds, dice)

def q3():
    dice1 = get_dice()
    dice2 = get_dice()

    if rot_compare(dice1, dice2):
        print("Yes")
    else:
        print("No")

def q4():
    inp = input()
    dice_num = int(inp)
    dice_list = list()
    for i in range(dice_num):
        dice_list.append(get_dice())

    if compare_many_dices(dice_list):
        print("No")

    else:
        print("Yes")

def alds1():
    n = int(input())
    A = [int(cont) for cont in input().split(" ")]

    print(' '.join(map(str, A)))

    for _i in range(len(A)-1):
        i = _i+1
        v = A[i]
        j = i-1

        while j >= 0:
            if A[j] < v:
                break

            A[j+1] = A[j]
            A[j] = v
            j = j - 1

        print(' '.join(map(str, A)))

def itp2_1_a():
    def pushBack(li, insertion):
        li.append(insertion)

    def randomAccess(li, dist):
        print(li[dist])

    def popBack(li):
        li.pop(-1)

    def func_allocate(mylist, inp):
        

        order, *a = spaced_to_ints(inp)
        if a:
            num = a[0]
        if order == 0:
            pushBack(mylist, num)

        if order == 1:
            randomAccess(mylist, num)

        if order == 2:
            popBack(mylist)

    mylist = list()
    count = count_order(input())

    for i in range(count):
        func_allocate(mylist, input())

itp2_1_a()

Solution (Python):
_q = int(input())
v = []
for _ in range(_q):
    *q, = map(int, input().split())

    if q[0] == 0:
        v.append(q[1])
    elif q[0] == 1:
        print(v[q[1]])
    elif q[0] == 2:
        v.pop()

Solution (Python):
n = int(input())
my_list = []
for _ in range(n):
    t = input().split()
    if t[0] == "0":
        my_list.append(int(t[1]))
    elif t[0] == "1":
        print(my_list[int(t[1])])
    else:
        my_list.pop(-1)

Solution (Python):
l = []

n = int(input())
for i in range(n):
    x = input().split()
    if len(x)==2:
        if int(x[0])==0:
            l.append(int(x[1]))
        elif int(x[0])==1:
            print(l[int(x[1])])
    else:
        l.pop()

Solution (Python):
def get_input():
  return list(map(lambda s: int(s), input().split(' ')))

n = get_input()[0]
l = []
for _ in range(n):
  c = get_input()
  if c[0] == 0: 
    l.append(c[1])
  elif c[0] == 1: 
    print(l[c[1]])
  elif c[0] == 2: 
    l = l[0:len(l)-1]

Solution (Python):
from collections import deque

q = int(input())
a = deque()

for i in range(q):
    inp = input()
    
    if inp[0] == "0":
        operation, x = list(map(int, inp.split()))
        a.append(x)

    
    elif inp[0] == "1":
        operation, p = list(map(int, inp.split()))
        print(a[p])

    
    else:
        a.pop()

Solution (Python):
listA = []
num = int(input())
for i in range(num):
    command = input().split()
    if command[0] == "0":
        listA.append(int(command[1]))
    elif command[0] == "1":
        print(listA[int(command[1])])
    elif command[0] == "2":
        listA.pop(-1)

Solution (Python):
import collections
q = int(input())
A = collections.deque()
ans = list()
for i in range(q):
    query = list(map(int, input().split()))
    if query[0] == 0:
        A.append(query[1])
    elif query[0] == 1:
        ans.append(A[query[1]])
    elif query[0] == 2:
        A.pop()
for a in ans:
    print(a)

Solution (Python):
a = []
q = int(input())
for _ in range(q):
    k = [int(i) for i in input().split()]
    if not k[0]:
        a.append(k[1])
    elif k[0] == 1:
        print(a[k[1]])
    else:
        del a[-1]

Solution (Python):
def main():
	q = int(input())
	a = []
	for _ in range(q):
		query = input()
		qn = query[0]
		if qn != "2":
			x = int(query[2:])
		if qn == "0":
			a += [x]
		elif qn == "1":
			print(a[x])
		else:
			a.pop(-1)

main()

Solution (Python):
import sys
input = sys.stdin.readline

Q = int(input())
A = []
ans = []

for _ in range(Q):
    q = list(map(int,input().split()))
    if q[0] == 0:
        A.append(q[1])
    elif q[0] == 1:
        ans.append(A[q[1]])
    else:
        A.pop()

print(*ans,sep='\n')

Solution (Python):
q = int(input())
v = []
for _ in range(q):
	op = list(map(int, input().split()))
	if op[0]==0:
		v.append(op[1])
	elif op[0]==1:
		print(v[op[1]])
	else:
		v.pop(len(v)-1)

Solution (Python):
from collections import deque

if __name__ == "__main__":

    n = int(input())
    queue = deque()

    for _ in range(n):
        param = input().split(" ")

        if param[0] == "0":
            queue.append(param[1])
        elif param[0] == "1":
            print(queue[int(param[1])])
        elif param[0] == "2":
            queue.pop()

Solution (Python):
class Vector():
    def __init__(self):
        self.vector = []

    def pushBack(self, x):
        self.vector.append(x)

    def randomAccess(self, p):
        return self.vector[p]

    def popBack(self):
        self.vector.pop()


num_queue = int(input())
vector = Vector()

for i in range(0, num_queue):
    queue = tuple(map(int, input().split(' ')))
    if queue[0] == 0:
        vector.pushBack(queue[1])
    elif queue[0] == 1:
        print(f'{vector.randomAccess(queue[1])}')
    elif queue[0] == 2:
        vector.popBack()

Solution (Python):

q=int(input())
S=list()

for i in range(q):
    query = input().split()
    
    if query[0] == '0':      
        S.append(query[1])
    
    elif query[0] == '1':    
        print("{}".format(S[int(query[1])]))
    
    elif query[0] == '2':    
        S.pop()

Solution (Python):
query_n = int(input())

lst = []

for _ in range(query_n):
    query = input().split()
    
    if query[0] == "0":
        lst.append(query[1])
    elif query[0] == "1":
        print(lst[int(query[1])])
    elif query[0] == "2":
        del lst[-1]

Solution (Python):
q = int(input())

l = []
for _ in range(q):
    a = input().split()
    if a[0] == "2":
        l.pop()
    else:
        m,q = map(int, a)
        if m == 0:
            l.append(q)
        else:
            print(l[q])

Solution (Python):
n = int(input())
dic = []
for i in range(n):
    a = list(map(int,input().split()))
    if len(a) == 1:
        del dic[-1]
    elif a[0] == 0:
        dic.append(a[1])
    else:
        print(dic[a[1]])

Solution (Python):






import sys
import math


class mymath:
    
    pi = 3.14159265358979323846264338

    
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    def pnum_check(self, n):
        if (n==1):
            return False
        elif (n==2):
            return True
        else:
            for x in range(2,n):
                if(n % x==0):
                    return False
            return True

    
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans
    
    
    def is_integer(self, n):
        try:
            float(n)
        except ValueError:
            return False
        else:
            return float(n).is_integer()

    
    def dist(self, A, B):
        d = 0
        for i in range(len(A)):
            d += (A[i]-B[i])**2            
        d = d**(1/2)
        return d

    
    def abs(self, n):
        if n >= 0:
            return n
        else:
            return -n

mymath = mymath()


class output:
    
    def list(self, l):
        l = list(l)
        
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()






















def printA(A):
    N = len(A)
    for i, n in enumerate(A):
        print(n, end='')
        if i != N-1:
            print(' ', end='')
    print()










def get_input():
    N = []
    while True:
        try:
            N.append(input())
            
            
            
        except EOFError:
            break
    return N

q = int(input())
A = []

for i in range(q):
    que = [int(x) for x in input().split()]
    if que[0] == 0:
        A.append(que[1])
    elif que[0] == 1:
        print(A[que[1]])
    elif que[0] == 2:
        A.pop()