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 N = 200010;
const int M = 300010;
const int Q = 500010;
int n, m, q, bad[M], p[N], t[Q], v[Q], ans[Q], a[M], b[M];
vector<pair<int, int> > g[N];
vector<int> arr;
vector<pair<int, int> > add;
int dsu[N];
int Find(int u) { return (u == dsu[u] ? u : dsu[u] = Find(dsu[u])); }
int dsu2[N], sz[N];
set<pair<int, int> > st[N];
set<pair<int, int> >::iterator it;
int Find2(int u) { return (u == dsu2[u] ? u : Find2(dsu2[u])); }
int ll, lll[N];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a[i], &b[i]);
    bad[i] = -1;
  }
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &t[i], &v[i]);
    v[i]--;
    if (t[i] == 2) bad[v[i]] = i;
  }
  for (int i = 1; i <= n; i++) dsu[i] = i;
  for (int u, v, i = 0; i < m; i++) {
    if (bad[i] != -1) continue;
    u = Find(a[i]);
    v = Find(b[i]);
    if (u == v) continue;
    dsu[u] = v;
    arr.push_back(i);
  }
  int tmp1, tmp2;
  for (int idx, i = q - 1; i >= 0; i--) {
    if (t[i] == 2) {
      idx = v[i];
      tmp1 = Find(a[idx]);
      tmp2 = Find(b[idx]);
      if (tmp1 == tmp2) continue;
      dsu[tmp1] = tmp2;
      arr.push_back(idx);
    }
  }
  for (int i = 1; i <= n; i++) {
    sz[i] = 1;
    dsu2[i] = i;
    st[i].insert(make_pair(p[i], i));
  }
  for (int u, v, i = 0; i < (int)arr.size(); i++) {
    u = Find2(a[arr[i]]);
    v = Find2(b[arr[i]]);
    if (sz[u] > sz[v]) swap(u, v);
    for (auto it = st[u].begin(); it != st[u].end(); it++) {
      st[v].insert(*it);
    }
    dsu2[u] = v;
    sz[v] += sz[u];
    add.push_back(make_pair(u, v));
  }
  for (int i = 0; i < q; i++) {
    if (t[i] == 2) {
      if ((int)arr.size() == 0 || v[i] != arr.back()) continue;
      tmp1 = add.back().first;
      tmp2 = add.back().second;
      add.pop_back();
      arr.pop_back();
      sz[tmp2] -= sz[tmp1];
      dsu2[tmp1] = tmp1;
      ll = 0;
      for (auto it = st[tmp1].begin(); it != st[tmp1].end(); it++) {
        lll[ll++] = it->second;
      }
      st[tmp1].clear();
      for (int j = 0; j < ll; j++) {
        st[tmp1].insert(make_pair(p[lll[j]], lll[j]));
        st[tmp2].erase(st[tmp2].find(make_pair(p[lll[j]], lll[j])));
      }
      continue;
    }
    v[i]++;
    tmp1 = Find2(v[i]);
    it = st[tmp1].end();
    it--;
    tmp2 = it->second;
    st[tmp1].erase(it);
    printf("%d\n", p[tmp2]);
    p[tmp2] = 0;
    st[tmp1].insert(make_pair(p[tmp2], tmp2));
  }
  return 0;
}
