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>
using namespace std;
#define rep(i,a,b) for(auto i = (a); i < (b); i++)
#define pb push_back
#define fs first
#define sc second
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;

const double EPS = 1e-9;

typedef pair<int,ii> T;

set<ii> BST[200'050];
struct union_find {
	vi p;
    vi sz;
    vi A;

    vector<set<int>> BACK;

	union_find(int n, vi &b) : A(b), p(n), sz(n,1), BACK(n,set<int>()) { 
        rep(i,0,n) p[i] = i; 
        rep(i,0,n) BST[i].insert(ii(A[i],i));
    }


    stack<T> q;
    int cur = 0;

	int find(int a) { 
        if(a == p[a]) return a;
        return find(p[a]);
    }

    int best(int a) {
        a = find(a);
        if(BST[a].size() == 0) return 0;
        ii val = *(--BST[a].end());
        BST[a].erase(val);
        A[val.sc] = 0;
        return val.fs;
    }

	bool joined(int a, int b) { 
        return find(a) == find(b);
    }

    void change(int at, int from, int to) {
        BST[from].erase(ii(A[at],at));
        BST[to].insert(ii(A[at],at));
        for(auto a : BACK[at]) {
            change(a, from, to);
        }
    }

	void unite(int a, int b) { 

        a = find(a);
        b = find(b);
        if(a == b) {
            q.push(T(-1,ii(0,0)));
            return;
                
        }

        if(sz[find(a)] < sz[find(b)]) {
            // go through smaller size remove and add to other
            change(a, a, b);

            sz[find(b)] += sz[find(a)];

            q.push( T(cur, ii(a, p[a])) );
            BACK[b].insert(find(a));

            p[find(a)] = find(b);

        } else {
            change(b, b, a);

            sz[find(a)] += sz[find(b)];
            q.push( T(cur, ii(b, p[b])) );

            BACK[a].insert(find(b));

            p[find(b)] = find(a);

        }
    }

    void pop() {
        T a = q.top();
        q.pop();
        if(a.fs == -1) return;
        change(a.sc.fs, find(a.sc.fs), a.sc.fs);
        BACK[find(a.sc.fs)].erase(a.sc.fs);
        sz[find(a.sc.fs)] -= sz[a.sc.fs];
        p[a.sc.fs] = a.sc.sc;
    }
};


int main() {
    cin.sync_with_stdio(false);
    int n,m,q;
    cin >> n >> m >> q;

    vi A(n);
    rep(i,0,n) cin >> A[i];
    vii E;
    rep(i,0,m) {
        int u,v;
        cin >> u >> v;
        u--;v--;
        E.pb(ii(u,v));
    }
    union_find un(n, A);

    vii OP(q);
    rep(i,0,q) cin >> OP[i].fs >> OP[i].sc;
    for(int i = q-1; i >= 0; i--) {
        if(OP[i].fs == 2) {
            un.unite(E[OP[i].sc-1].sc, E[OP[i].sc-1].fs);
        }
    }
    for(int i = 0; i < q; i++) {
        if(OP[i].fs == 1) {
            int val = un.best(OP[i].sc-1);
            cout << val << endl;
        } else {
            un.pop();
        }
    }
}
