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 = lambda: sys.stdin.readline().rstrip()

class SegmentTree():
    def __init__(self, init, unitX, f):
        self.f = f # (X, X) -> X
        self.unitX = unitX
        self.f = f
        if type(init) == int:
            self.n = init
            self.n = 1 << (self.n - 1).bit_length()
            self.X = [unitX] * (self.n * 2)
        else:
            self.n = len(init)
            self.n = 1 << (self.n - 1).bit_length()
            self.X = [unitX] * self.n + init + [unitX] * (self.n - len(init))
            for i in range(self.n-1, 0, -1):
                self.X[i] = self.f(self.X[i*2], self.X[i*2|1])
        
    def update(self, i, x):
        i += self.n
        self.X[i] = x
        i >>= 1
        while i:
            self.X[i] = self.f(self.X[i*2], self.X[i*2|1])
            i >>= 1
    
    def getvalue(self, i):
        return self.X[i + self.n]
    
    def getrange(self, l, r):
        l += self.n
        r += self.n
        al = self.unitX
        ar = self.unitX
        while l < r:
            if l & 1:
                al = self.f(al, self.X[l])
                l += 1
            if r & 1:
                r -= 1
                ar = self.f(self.X[r], ar)
            l >>= 1
            r >>= 1
        return self.f(al, ar)
    
    # Find r s.t. calc(l, ..., r-1) = True and calc(l, ..., r) = False
    def max_right(self, l, z):
        if l >= self.n: return self.n
        l += self.n
        s = self.unitX
        while 1:
            while l % 2 == 0:
                l >>= 1
            if not z(self.f(s, self.X[l])):
                while l < self.n:
                    l *= 2
                    if z(self.f(s, self.X[l])):
                        s = self.f(s, self.X[l])
                        l += 1
                return l - self.n
            s = self.f(s, self.X[l])
            l += 1
            if l & -l == l: break
        return self.n
    
    # Find l s.t. calc(l, ..., r-1) = True and calc(l-1, ..., r-1) = False
    def min_left(self, r, z):
        if r <= 0: return 0
        r += self.n
        s = self.unitX
        while 1:
            r -= 1
            while r > 1 and r % 2:
                r >>= 1
            if not z(self.f(self.X[r], s)):
                while r < self.n:
                    r = r * 2 + 1
                    if z(self.f(self.X[r], s)):
                        s = self.f(self.X[r], s)
                        r -= 1
                return r + 1 - self.n
            s = self.f(self.X[r], s)
            if r & -r == r: break
        return 0
    
    def check(self, randX):
        f = self.f
        unitX = self.unitX
        err = 0
        for _ in range(100):
            x = randX()
            y = randX()
            z = randX()
            if not f(x, unitX) == f(unitX, x) == x:
                err = 1
                print("!!!!! unitX Error !!!!!")
                print("unitX =", unitX)
                print("x =", x)
                print("f(x, unitX) =", f(x, unitX))
                print("f(unitX, x) =", f(unitX, x))
            
            if not f(f(x, y), z) == f(x, f(y, z)):
                err = 1
                print("!!!!! Associativity Error X !!!!!")
                print("x, y, z, f(x, y), f(y, x) =", x, y, z, f(x, y), f(y, x))
                print("f(f(x, y), z) =", f(f(x, y), z))
                print("f(x, f(y, z)) =", f(x, f(y, z)))
            
            assert err == 0
        print("Seg Tree Check OK!")
    
    def debug(self):
        print("debug")
        print([self.getvalue(i) for i in range(min(self.n, 20))])


def par(a):
    L = []
    while P[a] >= 0:
        L.append(a)
        a = P[a]
    for l in L:
        P[l] = a
    return a
def unite(a, b):
    if par(a) != par(b):
        if P[par(b)] >= P[par(a)]:
            NE[LA[par(a)]] = par(b)
            LA[par(a)] = LA[par(b)]
            P[par(a)] += P[par(b)]
            P[par(b)] = par(a)
        else:
            NE[LA[par(b)]] = par(a)
            LA[par(b)] = LA[par(a)]
            P[par(b)] += P[par(a)]
            P[par(a)] = par(b)

N, M, q = map(int, input().split())
A = [int(a) for a in input().split()]
NN = N
P = [-1] * NN
LA = [i for i in range(NN)]
NE = [-1] * NN

E = []
Q = []
D = set()
for _ in range(M):
    a, b = map(int, input().split())
    E.append((a-1, b-1))
for _ in range(q):
    t, i = map(int, input().split())
    Q.append((t, i-1))
    if t == 2:
        D.add(i-1)

E0 = [e for i, e in enumerate(E) if i not in D]
for a, b in E0:
    unite(a, b)
T1 = []
for t, i in Q[::-1]:
    if t == 1:
        pi = par(i)
        T1.append((pi, -P[pi]))
    else:
        a, b = E[i]
        unite(a, b)

T1 = T1[::-1]
pp = [i for i in range(NN) if par(i) == i]
for i in range(len(pp) - 1):
    NE[LA[pp[i]]] = pp[i+1]
LL = [pp[0]]
IL = [0] * NN
for i in range(NN - 1):
    ne = NE[LL[-1]]
    IL[ne] = i + 1
    LL.append(ne)

f = max
unit = 0
st = SegmentTree(N, unit, f)
if False:
    from random import randrange
    randX = lambda: randrange(20)
    st.check(randX)
# st.debug()
for i, p in enumerate(A):
    st.update(IL[i], (p << 18) + IL[i])

mm = (1 << 18) - 1
for a, w in T1:
    l = IL[a]
    r = l + w
    ma = st.getrange(l, r)
    s, i = ma >> 18, ma & mm
    st.update(i, 0)
    print(s)
    # st.debug()

