9 5 14
7 1 4 8 5 2 6 9 3
2 8
1 6
5 7
1 3
3 9
1 5
1 8
1 5
1 4
1 8
1 3
1 5
1 5
1 7
1 7
2 3
1 2
1 1
1 2
 6 5 8
1 2 6 3 4 5
2 4
1 3
1 6
3 5
2 5
1 1
1 4
1 1
2 1
2 5
2 2
2 3
1 4
 2 1 3
1 2
1 2
1 1
1 1
1 1

6
9
5
8
1
7
0
0
0
0
0
4
0
 6
5
4
3
 2
1
0

n,m,q=list(map(int,input().split()))
list_n=list(map(int,input().split()))
list_n.insert(0,-1)
list_edges=[[]]
list_connect=[]

for k in range(n+1):
    list_connect.append([])

for i in range(m):
    temp=list(map(int,input().split()))
    list_edges.append(temp)
    list_connect[temp[0]].append(temp[1])
    list_connect[temp[1]].append(temp[0])

for j in range(q):
    num,query=list(map(int,input().split()))
    if num==1:
        max=query
        for l in list_connect[query]:
            if list_n[max]<list_n[l]:
                max=l
        print(list_n[max])
        list_n[max]=0
    else:
        temp=list_edges.pop(query)
        list_edges.insert(1,[])

        try:
            list_connect[temp[0]].remove(temp[1])
        except:
            m=10
        
        try:
            list_connect[temp[1]].remove(temp[0])
        except:
            n=10

    


