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 iinf = 1e9 + 10;
const long long inf = 1ll << 60;
const long long mod = 1e9 + 7;
void GG() {
  cout << "0\n";
  exit(0);
}
long long mpow(long long a, long long n, long long mo = mod) {
  long long re = 1;
  while (n > 0) {
    if (n & 1) re = re * a % mo;
    a = a * a % mo;
    n >>= 1;
  }
  return re;
}
long long inv(long long b, long long mo = mod) {
  if (b == 1) return b;
  return (mo - mo / b) * inv(mo % b, mo) % mo;
}
const int maxn = 3e5 + 5;
const int maxm = 3e5 + 5;
vector<pair<int, int> > g[maxn];
int dt[maxm];
int val[maxn];
bool dead[maxn];
int n, m, q;
vector<int> pq[maxn];
const int BS = 500;
int col[maxn];
void dcol(int v, int c, int TT) {
  col[v] = c;
  if (!dead[val[v]]) pq[c].push_back(val[v]);
  for (pair<int, int> &u : g[v]) {
    if (dt[u.second] > TT && col[u.first] == 0) {
      dcol(u.first, c, TT);
    }
  }
}
int A[maxn], B[maxn];
vector<pair<int, int> > G[maxn];
int bg = 0, frm = -1;
bool seen[maxn];
vector<int> touch;
void dfs(int v, int TT) {
  seen[v] = 1;
  if ((int)pq[v].size() && pq[v].back() > bg) {
    bg = pq[v].back();
    frm = v;
  }
  for (pair<int, int> &u : G[v]) {
    if (dt[u.second] > TT && !seen[u.first]) {
      dfs(u.first, TT);
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> m >> q;
  memset(dt, 0x3f, sizeof dt);
  for (int i = 0; i < n; ++i) {
    cin >> val[i];
  }
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    g[a].push_back({b, i});
    g[b].push_back({a, i});
    A[i] = a;
    B[i] = b;
  }
  int NOWT = 0;
  vector<pair<int, int> > vt;
  vector<int> dat;
  for (int cnt = 0; cnt < q; ++cnt) {
    int tp;
    cin >> tp;
    if (tp == 1) {
      int v;
      cin >> v;
      vt.push_back({v - 1, NOWT});
    } else {
      NOWT++;
      int e;
      cin >> e;
      --e;
      dat.push_back(e);
      dt[e] = NOWT;
    }
    bool added = 0;
    if (cnt == q - 1 && tp != 2) ++NOWT, added = 1;
    if ((tp == 2 && NOWT % BS == 0) || cnt == q - 1) {
      ;
      if ((int)vt.size() == 0) continue;
      int NCOL = 1;
      memset(col, 0, sizeof col);
      for (int i = 0; i < n; ++i) {
        if (col[i] == 0) {
          pq[NCOL].clear();
          dcol(i, NCOL++, NOWT - 1);
        }
      };
      ;
      vector<int> hv;
      set<pair<int, int> > sen;
      for (int i = NOWT - added - 1; i >= vt[0].second; --i) {
        if (sen.count({col[A[dat[i]]], col[B[dat[i]]]})) continue;
        G[col[A[dat[i]]]].push_back({col[B[dat[i]]], dat[i]});
        G[col[B[dat[i]]]].push_back({col[A[dat[i]]], dat[i]});
        hv.push_back(col[A[dat[i]]]);
        hv.push_back(col[B[dat[i]]]);
        sen.insert({col[A[dat[i]]], col[B[dat[i]]]});
      }
      (sort(hv.begin(), hv.end()),
       hv.resize(distance(hv.begin(), unique(hv.begin(), hv.end()))));
      for (int y : hv) {
        sort(pq[y].begin(), pq[y].end());
      }
      for (pair<int, int> &p : vt) {
        ;
        bg = 0;
        frm = -1;
        dfs(col[p.first], p.second);
        cout << bg << '\n';
        if (bg != 0) {
          pq[frm].pop_back();
          dead[bg] = 1;
        }
        for (int &x : hv) seen[x] = 0;
      }
      for (int y : hv) G[y].clear();
      vt.clear();
    }
  }
}
