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

def mkGraph(n,m,q,p,edges,queries):
    reachability = {}
    for i in range(1,n+1):
        reachability[i] = set([i])
    for s,d in edges:
        reachability[s].add(d)
        reachability[d].add(s)
    for qtyp,i in queries:
        if qtyp==1:
            u = max(reachability[i], key=lambda x: p[x])
            print(p[u])
            p[u] = 0
            # print(p)
        else:
            a,b = edges[i-1]
            reachability[a].remove(b)
            reachability[b].remove(a)
            # print(reachability)
    return

n,m,q = map(int, input().split())
p = [0] + list(map(int, input().split()))
edges = []
for i in range(m):
    a,b = map(int, input().split())
    edges.append((a,b))
queries = []
for i in range(q):
    a,b = map(int, input().split())
    queries.append((a,b))
mkGraph(n,m,q,p,edges,queries)