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 = map(int, input().split())
values_list = [0] + list(map(int, input().split()))
values = {}
for i in range(1, n + 1):
    values[i] = values_list[i]
edges = {}
for i in range(1, m + 1):
    x, y = map(int, input().split())
    edges[i] = [x, y]

for i in range(q):
    w, v = map(int, input().split())
    if w == 1:
        marks = set([v]) 
        result = values[v] 
        deleted = v
        for i in edges:
            x, y = edges[i]
            if (x in marks) or (y in marks):
                marks.add(x)
                marks.add(y)
                if values[x] > result:
                    result = values[x]
                    deleted = x
                if values[y] > result:
                    result = values[y]
                    deleted = y
        values[deleted] = 0
        print(result)
    else: 
        edges.pop(v)
        m -= 1