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;

const int N = 2'000'003;

vector<pair<int, int>> g[N];
int link[N];
int v[N], a[N], b[N], q_type[N], q_index[N], deleted[N], smaller[N], new_root[N];

struct comp {
    bool operator()(const int &a, const int &b) {
        return make_pair(v[a], a) < make_pair(v[b], b);
    }
};
set<int, comp> s[N];

int find(int v) {
    if (link[v] == v)
        return v;
    int x = find(link[v]);
    link[v] = x;
    return x;
}

void join(int v1, int v2) {
    v1 = find(v1);
    v2 = find(v2);
    /*if (v1 == v2)
        return;*/
    // cout << "v1: " << v1 << "\tv2: " << v2 << "\n";
    // for (auto it : s[v1])
    //     cout << it << " ";
    // cout << "\n";
    // for (auto it : s[v2])
    //     cout << it << " ";
    // cout << "\n\n";
    if (v1 == v2)
        return;
    if (s[v1].size() > s[v2].size())
        swap(v1, v2);
    link[v1] = v2;
    for (auto it : s[v1]) {
        s[v2].insert(it);
        link[it] = v2;
    }
    s[v1].clear();
    // for (auto it : s[v2])
    //     cout << it << " ";
    // cout << "\n\n\n";
}

int size(int v) {
    return s[find(v)].size();
}

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

int query(int vertex) {
    vertex = find(vertex);
    int result_v = *(s[vertex].rbegin());
    int result_value = v[result_v];
    s[vertex].erase(result_v);
    v[result_v] = 0;
    s[vertex].insert(result_v);
    return result_value;
}

int vis[N];
int dfs_count = 0;
void dfs(int v, int new_root, int old_root) {
    vis[v] = dfs_count;
    link[v] = new_root;
    s[old_root].erase(v);
    s[new_root].insert(v);
    for (auto it : g[v]) {
        if (deleted[it.first] || vis[it.second] == dfs_count)
            continue;
        dfs(it.second, new_root, old_root);
    }
}

void remove(int edge, int smaller, int new_root) {
    int larger = a[edge];
    if (larger == smaller)
        larger = b[edge];
    //cout << "Smaller: " << smaller << "\tLarger: " << larger << "\n";
    int old_v = find(larger);
    int new_v = new_root;
    dfs_count++;
    dfs(new_v, new_v, old_v);
}

void solve() {
    int n, m, q;
    cin >> n >> m >> q;
    for (int i = 1; i <= n; i++) {
        cin >> v[i];
    }
    for (int i = 1; i <= n; i++) {
        link[i] = i;
        s[i].insert(i);
    }
    for (int i = 1; i <= m; i++) {
        cin >> a[i] >> b[i];
        g[a[i]].push_back(make_pair(i, b[i]));
        g[b[i]].push_back(make_pair(i, a[i]));
    }
    for (int i = 0; i < q; i++) {
        cin >> q_type[i] >> q_index[i];
    }
    for (int i = 0; i < q; i++) {
        if (q_type[i] == 2)
            deleted[q_index[i]] = 1;
    }
    for (int i = 1; i <= m; i++) {
        if (!deleted[i]) {
            join(a[i], b[i]);
        }
    }
    for (int i = q - 1; i >= 0; i--) {
        if (q_type[i] == 2) {
            int edge = q_index[i];
            if (same_component(a[edge], b[edge])) {
                smaller[i] = -1;
                continue;
            }
            if (size(a[edge]) < size(b[edge])) {
                smaller[i] = a[edge];
                new_root[i] = find(a[edge]);
            }
            else {
                smaller[i] = b[edge];
                new_root[i] = find(b[edge]);
            }
            join(a[edge], b[edge]);
            deleted[edge] = 0;
        }
    }
    /*cout << "Links: ";
    for (int i = 1; i <= n; i++) {
        cout << link[i] << " ";
    }
    cout << "\n";
    cout << "Sets:\n";
    for (int i = 0; i <= n; i++) {
        cout << i << ": ";
        for (auto it : s[i])
            cout << it << " ";
        cout << "\n";
    }
    cout << "\n";*/
    for (int i = 0; i < q; i++) {
        if (q_type[i] == 1) {
            cout << query(q_index[i]) << "\n";
        }
        else {
            /*cout << "Links Before: ";
            for (int i = 1; i <= n; i++) {
                cout << link[i] << " ";
            }
            cout << "\n";*/
            deleted[q_index[i]] = 1;
            if (smaller[i] == -1) {
                continue;
            }
            else {
                remove(q_index[i], smaller[i], new_root[i]);
            }
            /*cout << "Links After: ";
            for (int i = 1; i <= n; i++) {
                cout << link[i] << " ";
            }
            cout << "\n\n";*/
        }
    }
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    //cin >> t;
    while(t--)
        solve();
}


