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

sys.setrecursionlimit(10**5)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

class SegtreeMax():
    def __init__(self, aa):
        self.inf = 10 ** 16
        self.n = n = len(aa)
        self.tree_width = tree_width = 1 << (n - 1).bit_length()
        self.tree = [-self.inf] * (tree_width * 2 - 1)
        self.tree[tree_width-1:tree_width-1+n]=aa
        for u in range(tree_width - 2, -1, -1):
            self.tree[u] = max(self.tree[u * 2 + 1], self.tree[u * 2 + 2])

    def update(self, i, a):
        seg_i = self.tree_width - 1 + i
        self.tree[seg_i] = a
        while seg_i != 0:
            seg_i = (seg_i - 1) // 2
            self.tree[seg_i] = max(self.tree[seg_i * 2 + 1], self.tree[seg_i * 2 + 2])

    def element(self, i):
        return self.tree[self.tree_width - 1 + i]

    # [l,r)の最大値
    def max(self, l, r, seg_i=0, segL=0, segR=-1):
        if segR == -1: segR = self.tree_width
        if r <= segL or segR <= l: return -self.inf
        if l <= segL and segR <= r: return self.tree[seg_i]
        segM = (segL + segR) // 2
        ret0 = self.max(l, r, seg_i * 2 + 1, segL, segM)
        ret1 = self.max(l, r, seg_i * 2 + 2, segM, segR)
        return max(ret0, ret1)

    # [l,r)でrから左を見たとき、初めにaを超える値のインデックス
    def OverL(self, l, r, a, u=0, ul=0, ur=-1):
        if ur == -1: ur = self.tree_width
        if r <= ul or ur <= l or self.tree[u]<=a: return -1
        if ur-ul==1:return ul
        um = (ul + ur) // 2
        ret = self.OverL(l, r, a, u * 2 + 2, um, ur)
        if ret != -1: return ret
        return self.OverL(l, r, a, u * 2 + 1, ul, um)

    # [l,r)でlから右を見たとき、初めにaを超える値のインデックス
    def OverR(self, l, r, a, u=0, ul=0, ur=-1):
        if ur == -1: ur = self.tree_width
        if r <= ul or ur <= l or self.tree[u] <= a: return self.n
        if ur - ul == 1: return ul
        um = (ul + ur) // 2
        ret = self.OverR(l, r, a, u * 2 + 1, ul,um)
        if ret != self.n: return ret
        return self.OverR(l, r, a, u * 2 + 2, um,ur)

n,m,q=MI()
pp=LI()
uv=LLI1(m)
qr=LLI1(q)

uf=[-1]*n
def root(u):
    if uf[u]<0:return u
    # uf[u]=root(uf[u])
    # return uf[u]
    return root(uf[u])

def merge(u,v):
    u=root(u)
    v=root(v)
    if u==v:return False
    r=len(uf)
    uf.append(uf[u]+uf[v])
    uf[u]=uf[v]=r
    return True

rem=[False]*n
for op,i in qr:
    if op:rem[i]=True

for i,(u,v) in enumerate(uv):
    if rem[i]:continue
    merge(u,v)
# print(uf)

boss=[-1]*q
for qi in range(q-1,-1,-1):
    op,x=qr[qi]
    if op:
        u,v=uv[x]
        merge(u,v)
    else:
        boss[qi]=root(x)
# print(uf)
# print(boss)

ss=[]
to=[[] for _ in range(len(uf))]
for u,p in enumerate(uf):
    if p<0:ss.append(u)
    else:to[p].append(u)
# print("to",to)

aa=[]
ll=[-1]*len(uf)
rr=[-1]*len(uf)
atoi=[-1]*(n+1)

def dfs(u):
    if not to[u]:
        ll[u]=len(aa)
        a=pp[u]
        atoi[a]=len(aa)
        aa.append(a)
        rr[u]=len(aa)
        return
    for v in to[u]:dfs(v)
    ll[u]=ll[to[u][0]]
    rr[u]=rr[to[u][-1]]

for u in ss:dfs(u)
# print(ll,rr)

st=SegtreeMax(aa)
for i,(op,x) in enumerate(qr):
    if op==0:
        b=boss[i]
        l,r=ll[b],rr[b]
        a=st.max(l,r)
        print(i,b,l,r,a)
        st.update(atoi[a],0)
