#include <bits/stdc++.h>
using namespace std;
int n, m, q;
int dt[300101];
pair<int, int> e[300101];
struct qry {
  int ty, x;
  int dx, dy;
} Q[500101];
int f[200101], si[200101], p[200101], bel[200101], b[300101], del[300101];
vector<int> h[200101];
int getf(int x) { return x == f[x] ? x : getf(f[x]); }
void solve() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    f[i] = i, si[i] = 1;
    cin >> p[i];
    h[i].push_back(p[i]);
  }
  for (int i = 1; i <= m; i++) {
    cin >> e[i].first >> e[i].second;
  }
  for (int i = 1; i <= q; i++) {
    cin >> Q[i].ty >> Q[i].x;
    if (Q[i].ty == 2) b[Q[i].x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (b[i]) continue;
    int x = getf(e[i].first);
    int y = getf(e[i].second);
    if (x == y) continue;
    if (si[x] < si[y]) swap(x, y);
    for (int d : h[y]) h[x].push_back(d);
    f[y] = x, si[x] += si[y];
  }
  for (int i = q; i; i--) {
    if (Q[i].ty == 1) continue;
    int x = getf(e[Q[i].x].first);
    int y = getf(e[Q[i].x].second);
    if (x == y) continue;
    if (si[x] < si[y]) swap(x, y);
    Q[i].dx = x, Q[i].dy = y;
    for (int d : h[y]) h[x].push_back(d);
    f[y] = x, si[x] += si[y];
  }
  for (int i = 1; i <= n; i++) {
    sort(h[i].begin(), h[i].end());
    bel[p[i]] = getf(i);
  }
  for (int i = 1; i <= q; i++) {
    if (Q[i].ty == 1) {
      int d = Q[i].x;
      d = getf(d);
      while (h[d].size() && (bel[h[d].back()] != d || del[h[d].back()]))
        h[d].pop_back();
      if (h[d].size() == 0)
        cout << "0\n";
      else {
        cout << h[d].back() << "\n";
        del[h[d].back()] = 1;
        h[d].pop_back();
      }
    } else {
      for (int d : h[Q[i].dy]) bel[d] = Q[i].dy;
      f[Q[i].dy] = Q[i].dy;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
}
