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;
int p[500005], ind[500005], a[500005], b[500005], typ[500005], sz[500005];
int w[500005], n, m, q, num[500005], fix[500005];
vector<int> ver[500005], qu[500005];
set<int> st[1000002];
set<int>::iterator it;
int fin(int x) {
  if (x == p[x]) return x;
  return p[x] = fin(p[x]);
}
void join(int x, int y) {
  x = fin(x);
  y = fin(y);
  if (x == y) return;
  if (sz[y] > sz[x]) swap(x, y);
  p[y] = x;
  sz[x] += sz[y];
  for (int i = 0; i < ver[y].size(); i++) ver[x].push_back(ver[y][i]);
  ver[y].clear();
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
  }
  vector<int> g;
  for (int i = 1; i <= q; i++) {
    cin >> typ[i] >> w[i];
    if (typ[i] == 2) {
      g.push_back(w[i]);
      fix[w[i]] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    p[i] = i;
    sz[i] = 1;
    ver[i].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    if (!fix[i]) {
      join(a[i], b[i]);
    }
  }
  reverse(g.begin(), g.end());
  for (int i = 0; i < g.size(); i++) {
    int x = a[g[i]], y = b[g[i]];
    if (fin(x) == fin(y)) continue;
    x = fin(x);
    y = fin(y);
    if (sz[x] <= sz[y])
      for (int i = 0; i < ver[x].size(); i++) {
        qu[g[i]].push_back(ver[x][i]);
      }
    else
      for (int i = 0; i < ver[y].size(); i++) {
        qu[g[i]].push_back(ver[y][i]);
      }
    join(x, y);
  }
  for (int i = 1; i <= n; i++) {
    st[fin(i)].insert(num[i]);
    ind[i] = fin(i);
  }
  int nex = n + 1;
  for (int i = 1; i <= q; i++) {
    if (typ[i] == 1) {
      int x = w[i];
      if (st[ind[x]].size() == 0)
        cout << 0 << '\n';
      else {
        it = st[ind[x]].end();
        it--;
        cout << (*it) << '\n';
        st[ind[x]].erase(it);
      }
    } else {
      int x = w[i];
      int fi = ind[a[w[i]]];
      for (int i = 0; i < qu[x].size(); i++) {
        ind[qu[x][i]] = nex;
        if (st[fi].find(num[qu[x][i]]) != st[fi].end()) {
          st[nex].insert(num[qu[x][i]]);
          st[fi].erase(num[qu[x][i]]);
        }
      }
      nex++;
    }
  }
  return 0;
}
