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 long long sz = 2e5 + 10, esz = 3e5 + 10, qsz = 5e5 + 10;
int p[sz], erased[esz], par[sz], siz[sz];
struct info {
  long long a, b;
} edge[esz], qry[qsz];
struct rollback {
  int par, node, siz;
} chng[qsz];
long long findp(long long u) {
  if (par[u] == u) return u;
  return findp(par[u]);
}
vector<int> lst[sz];
const bool cmp(int &a, int &b) { return p[a] < p[b]; }
void dsu_uni(int u, int v, int id = 0) {
  int pu = findp(u), pv = findp(v);
  if (pu == pv) return;
  if (siz[pu] < siz[pv]) swap(pu, pv);
  if (id != 0) chng[id] = {pu, pv, siz[pu]};
  par[pv] = pu;
  lst[pu].insert(lst[pu].end(), lst[pv].begin(), lst[pv].end());
  siz[pu] += siz[pv];
}
int main() {
  long long n, m, q;
  cin >> n >> m >> q;
  for (long long i = 1; i <= n; ++i) scanf("%d", &p[i]);
  for (long long i = 1; i <= m; ++i)
    scanf("%lld", &edge[i].a), scanf("%lld", &edge[i].b);
  for (long long i = 1; i <= q; ++i) {
    scanf("%lld", &qry[i].a), scanf("%lld", &qry[i].b);
    if (qry[i].a == 2) erased[qry[i].b] = 1;
  }
  for (long long i = 1; i <= n; ++i)
    par[i] = i, siz[i] = 1, lst[i].push_back(i);
  for (long long i = 1; i <= m; ++i) {
    if (erased[i]) continue;
    dsu_uni(edge[i].a, edge[i].b);
  }
  for (long long i = q; i >= 1; --i) {
    if (qry[i].a == 1) continue;
    long long id = qry[i].b;
    dsu_uni(edge[id].a, edge[id].b, i);
  }
  for (long long i = 1; i <= n; ++i) sort(lst[i].begin(), lst[i].end(), cmp);
  for (long long i = 1; i <= q; ++i) {
    if (qry[i].a == 1) {
      long long pu = findp(qry[i].b);
      while (!lst[pu].empty()) {
        long long now = lst[pu].back(), pnow = findp(now);
        if (pnow != pu || p[now] == 0) {
          lst[pu].pop_back();
          continue;
        }
        break;
      }
      long long ans = 0;
      if (!lst[pu].empty()) ans = p[lst[pu].back()], p[lst[pu].back()] = 0;
      printf("%lld\n", ans);
    } else {
      par[chng[i].node] = chng[i].node;
      siz[chng[i].par] = chng[i].siz;
    }
  }
  return 0;
}
