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

import sys
input = sys.stdin.buffer.readline


class SegmentTree:
    def __init__(self, n, op, e):
        self.n = n
        self.op = op
        self.e = e
        self.size = 2 ** ((n - 1).bit_length())
        self.node = [self.e] * (2 * self.size)

    def __getitem__(self, i):
        return self.node[i + self.size]

    def __setitem__(self, i, val):
        i += self.size
        self.node[i] = val
        while i > 1:
            i >>= 1
            self.node[i] = self.op(self.node[i << 1], self.node[(i << 1) + 1])

    def build(self, array):
        for i, val in enumerate(array, self.size):
            self.node[i] = val
        for i in range(self.size - 1, 0, -1):
            self.node[i] = self.op(self.node[i << 1], self.node[(i << 1) + 1])

    def all_fold(self):
        return self.node[1] 
      
    def fold(self, l, r):
        l, r = l + self.size, r + self.size
        vl, vr = self.e, self.e
        while l < r:
            if l & 1:
                vl = self.op(vl, self.node[l])
                l += 1
            if r & 1:
                r -= 1
                vr = self.op(self.node[r], vr)
            l, r = l >> 1, r >> 1
        return self.op(vl, vr)


class UnionFind:
    def __init__(self, n):
        self.parent = [-1] * n
        self.n = n
        self.cnt = n

    def root(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x])
            return self.parent[x]

    def merge(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.parent[x] > self.parent[y]:
            x, y = y, x
        self.parent[x] += self.parent[y]
        self.parent[y] = x
        self.cnt -= 1
        return True

    def is_same(self, x, y):
        return self.root(x) == self.root(y)

    def size(self, x):
        return -self.parent[self.root(x)]

    def count(self):
        return self.cnt

    def groups(self):
        res = [[] for _ in range(self.n)]
        for i in range(self.n):
            res[self.root(i)].append(i)
        return [group for group in res if group]


class BinaryNode:
    def __init__(self, val=None):
        self.l, self.r, self.p = [None, None, None]
        self.val = val
        self.dist_l = 0
        self.dist_r = 0


n, m, q = map(int, input().split())
p = list(map(int, input().split()))
edges = [list(map(int, input().split())) for i in range(m)]
queries = [list(map(int, input().split())) for i in range(q)]


del_i = set()
for flag, i in queries:
    if flag == 2:
        del_i.add(i - 1)

uf = UnionFind(n)
for i, (a, b) in enumerate(edges):
    if i in del_i:
        continue
    a -= 1
    b -= 1
    uf.merge(a, b)

group = {}
nodes = {}
rt_set = set()
for i in range(n):
    rt = uf.root(i)
    if rt not in group:
        group[rt] = []
    group[rt].append(i)
    if rt in nodes:
       continue
    nodes[rt] = BinaryNode(rt)
    rt_set.add(rt)

q1_undo = []
q2_undo = []
for flag, i in queries[::-1]:
    if flag == 1:
        q1_undo.append(uf.root(i - 1))
    if flag == 2:
        a, b = edges[i - 1]
        a -= 1
        b -= 1
        if uf.is_same(a, b):
            q2_undo.append(None)
            q2_undo.append(None)
            continue
        else:
            rt_a = uf.root(a)
            rt_b = uf.root(b)
            uf.merge(a, b)
            rt_new = uf.root(a)

            node = BinaryNode(rt_new)
            nodes[rt_a].p = node
            nodes[rt_b].p = node
            node.l = nodes[rt_a]
            node.r = nodes[rt_b]

            q2_undo.append(rt_new)
            q2_undo.append(nodes[rt_new])
            nodes[rt_new] = node

            if rt_new == rt_a:
                rt_set.remove(rt_b)
            else:
                rt_set.remove(rt_a)

def dfs1(root, l):
    order.append(nodes[root])
    stack = [nodes[root]]
    while stack:
        nd = stack.pop()
        if nd is None:
            continue
        if nd.r is None and nd.l is None:
            array.append(nd.val)
            r = l + len(group[nd.val])
            nd.dist_l, nd.dist_r = l, r
            l = r
        if nd.r is not None:
            stack.append(nd.r)
            order.append(nd.r)
        if nd.l is not None:
            stack.append(nd.l)
            order.append(nd.l)
    return l

array = []
order = []
l = 0
for rt in rt_set:
    l = dfs1(rt, l)

while order:
    nd = order.pop()
    if nd.l is None:
        continue
    nd.dist_l, nd.dist_r = nd.r.dist_l, nd.r.dist_r

res = []
for i in array:
    for j in group[i]:
        res.append(j)
for i in range(n):
    res[i] = p[res[i]]

to_ind = [0] * (n + 1)
for i in range(n):
    to_ind[res[i]] = i

st = SegmentTree(n, max, 0)
st.build(res)

ans_print = []
for flag, i in queries:
    if flag == 1:
        rt = q1_undo.pop()
        l, r = nodes[rt].dist_l, nodes[rt].dist_r
        ans = st.fold(l, r)
        ans_print.append(ans)
        if ans == 0:
            continue
        st[to_ind[ans]] = 0
    else:
        nd = q2_undo.pop()
        ind = q2_undo.pop()
        if nd is None:
            continue
        else:
            nodes[ind] = nd

print("\n".join(map(str, ans_print)))