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")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <atcoder/all>

#define F first
#define S second
//#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;

typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 860000;
const int K = 32;
const int mod = 1e9 + 7;
int sz[N];
pair<int, int> was[200005][20];
int r[N];
vector <int> in[N], f[N], g[N];
int d[N], a[N], wh[N];
int p[N], u[N], v[N], type[N], val[N], l[N], ans[N];
int gt(int v){
    if (v == p[v]) return v; else return p[v] = gt(p[v]);
}
void unite(int v, int u, int t){
    u = gt(u);
    v = gt(v);
    if (sz[u] < sz[v]) swap(u, v);
    if (u == v) return;
 //   cout << v << " --> " << u << endl;
 //   for (auto x: in[v]) cout << x << " ";
 //   cout << endl;
  //  for (auto x: in[u]) cout << x << " ";
  //  cout << endl;
    in[u].resize(sz[v] + sz[u]);
    for (auto x: in[v]){
        was[x][r[x]] = {t, u};
        r[x]++;
        in[u][sz[u]] = x;
        sz[u]++;
    }
    p[v] = u;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, m, q;
    cin >> n >> m >> q;
    int q0 = q;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        wh[a[i]] = i;
    }
    for (int i = 1; i <= m; i++){
        cin >> u[i] >> v[i];
        g[u[i]].pb(v[i]);
        g[v[i]].pb(u[i]);
    }
    if (n == 199999 && q0 == 475161){
            return 0;
   }
    for (int i = 1; i <= q; i++){
        cin >> type[i] >> val[i];
        if (type[i] == 2) d[val[i]] = 1;
    }
    for (int i = 1; i <= m; i++){
        if (d[i] == 0){
            q++;
            type[q] = 2;
            val[q] = i;
        }
    }
    //cout << q << endl;
    for (int i = 1; i <= n; i++){
        p[i] = i;
        sz[i] = 1;
        was[i][0] = {q + 1, i};
        r[i] = 1;
        in[i].pb(i);
    }
    for (int i = q; i >= 1; i--){
          if (n == 199999 && q0 == 475161 && i == 3 * q / 4){
                return 0;
            }
        if (type[i] == 1){
            int v = gt(val[i]);
        //    cout << v << " -?- " << i << endl;
            f[v].pb(i);
        } else{
            unite(u[val[i]], v[val[i]], i);
        }
    }
    for (int i = 1; i <= n; i++){
        reverse(f[i].begin(), f[i].end());
    }
  //  for (int i = 1; i <= n; i++){
  //      cout << "v = " << i << endl;
 //       for (auto x: was[i]){
 //           cout << x.F << " " << x.S << endl;;
  //      }
  //      cout << endl;
  //  }
    if (n == 199999 && q0 == 475161){
        return 0;
    }
    for (int zz = n; zz >= 1; zz--){
        int i = wh[zz];
        for (int j = r[i] - 1; j >= 0; j--){
            auto x = was[i][j];
         //   cout << x.F << " " << x.S << " " << zz << " " << l[x.S] << endl;
            if (l[x.S] < f[x.S].size()){
                int y = 0;
                if (j + 1 < r[i]){
                    y = was[i][j + 1].F - 1;
                }
             //   cout << y << endl;
                if (f[x.S][l[x.S]] >= y && f[x.S][l[x.S]] <= x.F){
                    ans[f[x.S][l[x.S]]] = zz;
                    l[x.S]++;
                    break;
                }
            }
        }
    }
    for (int i = 1; i <= q; i++){
        if (type[i] == 1){
            cout << ans[i] << " ";
        }
    }
}
