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

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimization ("unroll-loops")
//#pragma comment(linker, "/STACK:16777216")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>

using namespace std;
using namespace __gnu_pbds;


#define LL long long
//#define int long long
#define fi first
#define se second
#define pll pair<LL, LL>
#define pii pair<LL, LL>
#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define SZ(x) ((int)(x.size()))
#define LC (id<<1)
#define RC (id<<1|1)

constexpr int N = 1e6+9;
constexpr int M = 3e5+9;
#ifdef int
constexpr int INF = 0x3f3f3f3f3f3f3f3f;
constexpr int INF2 = 0xcfcfcfcfcfcfcfcf;
#else
constexpr int INF = 0x3f3f3f3f;
constexpr int INF2 = 0xcfcfcfcf;
#endif

int p[N];
int fa[N];
vector<int> ch[N];
int tot;
int tmp;
int dfn[N], rk[N];
int st[N], ed[N];
int pa[20][N];
int del[N];

void init(int n) {
    for (int i = 1; i <= n; i++)
        fa[i] = i, del[i] = INF;
}
int find(int x) {
    if (fa[x] == x) return x;
    return fa[x] = find(fa[x]);
}
void merge(int x, int y, int id) {
    int px = find(x), py = find(y);
    if (px == py) return;
    fa[px] = ++tot;
    fa[py] = tot;
    del[tot] = id;
    ch[tot].emplace_back(px);
    ch[tot].emplace_back(py);
}
void dfs(int u) {
    dfn[u] = ++tmp;
    rk[tmp] = u;
    st[u] = tmp;
    for (int v: ch[u]) {
        pa[0][v] = u;
        dfs(v);
    }
    ed[u] = tmp;
}
void walk() {
    for (int i = 1; i <= tot; i++)
        if (fa[i] == i) dfs(i);
    for (int p = 1; p < 20; p++)
        for (int i = 1; i <= tot; i++)
            pa[p][tot] = pa[p-1][pa[p-1][tot]];
}
inline int getRoot(int u, int id) {
    int rt = u;
    for (int p = 19; p >= 0; p--)
        if (del[pa[p][rt]] > id)
            rt = pa[p][rt];
    return rt;
}
int mx[N];
inline int ma(int a, int b) {
    if (p[a] > p[b]) return a;
    return b;
}
inline void pushUp(int id) {
    mx[id] = ma(mx[LC], mx[RC]);
}
void build(int id, int l, int r) {
    if (l == r) mx[id] = rk[l];
    else {
        int m = (l+r)>>1;
        build(LC, l, m);
        build(RC, m+1, r);
        pushUp(id);
    }
}
void update(int id, int l, int r, int pos, int val) {
    if (l == r) {
        p[mx[id]] = val;
        return;
    }
    int m = (l+r)>>1;
    if (pos <= m) update(LC, l, m, pos, val);
    else update(RC, m+1, r, pos, val);
    pushUp(id);
}
int query(int id, int l, int r, int s, int e) {
    if (l == s && e == r) return mx[id];
    int m = (l+r)>>1;
    if (e <= m) return query(LC, l, m, s, e);
    if (s > m) return query(RC, m+1, r, s, e);
    return ma(query(LC, l, m, s, m), query(RC, m+1, e, m+1, e));
}

int n, m, q;
struct E {
    int u, v, del;
} e[N];
pii qs[N];

signed main() {
    fastio;
    cin >> n >> m >> q;
    for (int i = 1; i <= n; i++) cin >> p[i];
    for (int i = 1; i <= m; i++) cin >> e[i].u >> e[i].v, e[i].del = q + i;
    for (int i = 1; i <= q; i++) {
        cin >> qs[i].fi >> qs[i].se;
        if (qs[i].fi == 2) e[qs[i].se].del = i;
    }
    init(n+m);
    tot = n;
    sort(e+1, e+1+m, [](const E& e1, const E& e2) {
        return e1.del > e2.del;
    });
    for (int i = 1; i <= m; i++)
        //cout << e[i].u << " " << e[i].v << " " << e[i].del << "\n",
        merge(e[i].u, e[i].v, e[i].del);
    walk();
    build(1, 1, tmp);
    for (int i = 1; i <= q; i++) {
        if (qs[i].fi == 1) {
            int root = getRoot(qs[i].se, i);
            int ans = query(1, 1, tmp, st[root], ed[root]);
            //cout << i << ":" << qs[i].se << " " << root << " " << ans << "\n";
            cout << p[ans] << "\n";
            update(1, 1, tmp, dfn[ans], 0);
        }
    }
    return 0;
}