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 <bits/stdc++.h>

#define _FORTIFY_SOURCE 0
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")


#define ull unsigned long long
#define pll pair<ll, ll>
#define mp make_pair
#define ll int
#define ld long double
#define pb push_back
#define deb(x) cout << #x << " = " << x << endl
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define vi vector<ll>
typedef std::complex<ld> cmpl;



const ll mod1 = 1e9 + 7;
const ll mod2 = 998244353;
const ll P1 = 678463;
const ll P2 = 239;
const ll inf = (ll)1e18;
const long double MATH_E = 2.718281828459;
const long double eps = 1e-15;
const long double MATH_PI = atan2l(0, -1);


using namespace std;


template <class T>
istream& operator>>(istream &in, vector<T> &arr) {
    for (T &cnt : arr) {
        in >> cnt;
    }
    return in;
};


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


ll rnd(ll l, ll r) {
    std::uniform_int_distribution<ll> range(l, r);
    return range(rng);
}


struct edge {
    ll v, u;
};


void solve() {
    ll n, m, q, T = 0;
    cin >> n >> m >> q;
    ll bs = (ll)sqrt(q) + 1;
    vector<ll> p(n), wasErased(m), stepWhenWasErased(m);
    cin >> p;
    vector<edge> e(m);
    for (int i = 0; i < m; i++) {
        cin >> e[i].v >> e[i].u;
        e[i].v--;
        e[i].u--;
    }
    vector<pll> queries;
    vector<ll> rem(q + 1), used(n, -1), compIndex(n);
    vector<vector<ll>> g(n);
    vector<vector<pll>> gCompressed;
    vector<set<pll, greater<>>> compMax;

    function<void(ll, ll)> dfsCompress = [&](ll v, ll cI) {
        used[v] = T;
        compIndex[v] = cI;
        compMax[cI].insert({p[v], v});
        for (auto u : g[v]) {
            if (used[u] != T) {
                dfsCompress(u, cI);
            }
        }
    };

    function<pll(ll)> dfsQuery = [&](ll v) {
        pll res = *(compMax[v].begin());
        used[v] = T;
        for (auto x : gCompressed[v]) {
            if (used[x.first] != T and wasErased[x.second] == 0) {
                res = max(res, dfsQuery(x.first));
            }
        }
        return res;
    };

    for (int i = 1; i <= q; i++) {
        if (i < bs) {
            rem[i] = i;
        } else {
            rem[i] = rem[i - bs];
        }
        ll t, x;
        cin >> t >> x;
        x--;
        queries.pb({t, x});

        if (i == q or rem[i] == 0) {
            for (auto cnt : queries) {
                if (cnt.first == 2) {
                    stepWhenWasErased[cnt.second] = i;
                }
            }
            g.assign(n, {});
            for (int ei = 0; ei < m; ei++) {
                if (wasErased[ei] == 0 and stepWhenWasErased[ei] != i) {
                    g[e[ei].v].pb(e[ei].u);
                    g[e[ei].u].pb(e[ei].v);
                }
            }
            ll cI = 0;
            for (int v = 0; v < n; v++) {
                if (used[v] != T) {
                    compMax.pb(set<pll, greater<>>());
                    dfsCompress(v, cI);
                    cI++;
                }
            }
            T++;
            gCompressed.assign(cI, {});
            for (auto cnt : queries) {
                if (cnt.first == 2) {
                    gCompressed[compIndex[e[cnt.second].v]].pb({compIndex[e[cnt.second].u], cnt.second});
                    gCompressed[compIndex[e[cnt.second].u]].pb({compIndex[e[cnt.second].v], cnt.second});
                }
            }
            for (auto cnt : queries) {
                if (cnt.first == 2) {
                    wasErased[cnt.second] = 1;
                } else {
                    pll res = dfsQuery(compIndex[cnt.second]);
                    T++;
                    compMax[compIndex[res.second]].erase(res);
                    p[res.second] = 0;
                    cout << res.first << "\n";
                    compMax[compIndex[res.second]].insert({0, res.second});
                }
            }
            queries.clear();
        }
    }
}


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cout.precision(30);
    srand(time(0));
    cout.setf(ios::fixed);
    solve();
    return 0;
}
