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

#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <string>
#include <random>
#include <chrono>
#include <set>
#include <map>
using namespace std;
#ifdef MANSON
#define BUGO(x) cerr << #x << " = " << (x) << '\n';
#define BUGOARR(a) cerr << #a << ": "; for (auto i: a) cerr << i << ' '; cerr << '\n';
ostream& operator<<(ostream& out, const pair<auto, auto>& p) {
    return out << "{" << p.first << ", " << p.second << "}";
}
#else
#define BUGO(x)
#define BUGOARR(a)
#endif
using llong = long long;
using uint = unsigned int;
using ullong = unsigned long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); }
const int maxN = 200'005;

pair<int, int> tr[4 * maxN];
void Build(int v, int vl, int vr)
{
    if (vl == vr) {
        tr[v] = {0, vr};
        return;
    }
    int vm = (vl + vr) / 2;
    Build(v * 2, vl, vm);
    Build(v * 2 + 1, vm + 1, vr);
    tr[v] = tr[v * 2];
}
void Set(int v, int vl, int vr, int i, int val)
{
    if (vl == vr) {
        tr[v] = {val, i};
        return;
    }
    int vm = (vl + vr) / 2;
    if (i <= vm)
        Set(v * 2, vl, vm, i, val);
    else
        Set(v * 2 + 1, vm + 1, vr, i, val);
    tr[v] = max(tr[v * 2], tr[v * 2 + 1]);
}
pair<int, int> Max(int v, int vl, int vr, int l, int r)
{
    if (l > vr || vl > r) return {0, -1};
    if (l <= vl && vr <= r) return tr[v];
    int vm = (vl + vr) / 2;
    return max(Max(v * 2, vl, vm, l, r), Max(v * 2 + 1, vm + 1, vr, l, r));
}

int val[maxN];

int par[maxN];
vector<int> ord[maxN];

int Root(int v) {
    return par[v] == v ? v : par[v] = Root(par[v]);
}
void Union(int u, int v) {
    u = Root(u); v = Root(v);
    if (u == v) return;
    if (ord[u].size() > ord[v].size()) swap(u, v);
    ord[v].insert(ord[v].end(), ord[u].begin(), ord[u].end());
    vector<int>().swap(ord[u]);
    par[u] = v;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m, qnum;
    cin >> n >> m >> qnum;
    for (int i = 1; i <= n; ++i) {
        par[i] = i;
        ord[i].push_back(i);
    }
    for (int v = 1; v <= n; ++v)
        cin >> val[v];
    vector<pair<int, int>> edges; edges.reserve(m);
    for (int i = 0; i < m; ++i)
    {
        int u, v;
        cin >> u >> v;
        edges.push_back({u, v});
    }
    vector<pair<int, int>> q(qnum);
    vector<int> isCut(m);
    for (int i = 0; i < qnum; ++i) {
        int tp, j;
        cin >> tp >> j;
        if (tp == 1)
            q[i] = {tp, j};
        else {
            q[i] = {tp, --j};
            isCut[j] = true;
        }
    }
    for (int i = 0; i < m; ++i)
        if (!isCut[i])
            Union(edges[i].first, edges[i].second);
    for (int x = qnum - 1; x >= 0; --x)
    {
        auto [tp, i] = q[x];
        if (tp == 1) continue;
        auto [u, v] = edges[i];
        Union(u, v);
    }
    vector<int> a; a.reserve(n);
    set<int> cuts;
    for (int i = 1; i <= n; ++i)
        if (Root(i) == i) {
            cuts.insert(a.size());
            a.insert(a.end(), ord[i].begin(), ord[i].end());
        }
    cuts.insert(a.size());
    vector<int> indof(n + 1);
    Build(1, 0, n - 1);
    for (int i = 0; i < n; ++i) {
        indof[a[i]] = i;
        Set(1, 0, n - 1, i, val[a[i]]);
    }
    for (int x = 0; x < qnum; ++x)
    {
        auto [tp, i] = q[x];
        if (tp == 1)
        {
            int l = *prev(cuts.upper_bound(indof[i]));
            int r = *cuts.upper_bound(indof[i]) - 1;
            pair<int, int> p = Max(1, 0, n - 1, l, r);
            cout << p.first << '\n';
            if (p.second != -1)
                Set(1, 0, n - 1, p.second, 0);
        }
        else
        {
            auto [u, v] = edges[i];
            if (indof[u] > indof[v]) swap(u, v);
            if (indof[u] + 1 == indof[v])
                cuts.insert(indof[v]);
        }
    }
}
