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 MAXN = 500100;
int v[MAXN];
pair<int, int> grafo[MAXN], q[MAXN];
bool are[MAXN];
int p[MAXN];
int pai[MAXN];
vector<int> vec[MAXN];
struct seg {
  seg *fe, *fd;
  int meio, l, r;
  pair<int, int> mex;
  seg(int x, int y) {
    meio = (x + y) / 2;
    l = x, r = y;
    mex = {-1, 0};
    if (l == r) return;
    fe = new seg(x, meio);
    fd = new seg(meio + 1, y);
  }
  void up(int pos, int novo) {
    if (l == r) {
      mex = {novo, l};
      return;
    }
    if (pos <= meio)
      fe->up(pos, novo);
    else
      fd->up(pos, novo);
    if (fe->mex.first >= fd->mex.first)
      mex = fe->mex;
    else
      mex = fd->mex;
  }
  pair<int, int> get(int a, int b) {
    if (l >= a && r <= b) return mex;
    if (l > b || r < a) return {-1, 0};
    pair<int, int> re = fe->get(a, b), rd = fd->get(a, b);
    if (re.first >= rd.first) return re;
    return rd;
  }
};
int find(int x) {
  if (pai[x] == x) return x;
  return pai[x] = find(pai[x]);
}
void join(int a, int b) {
  a = find(a), b = find(b);
  if (vec[a].size() >= vec[b].size()) {
    for (int i = 0; i < vec[b].size(); i++) vec[a].push_back(vec[b][i]);
    pai[b] = a;
  } else {
    for (int i = 0; i < vec[a].size(); i++) vec[b].push_back(vec[a][i]);
    pai[a] = b;
  }
}
seg st(0, MAXN);
int main() {
  int n, m, Q;
  scanf("%d %d %d", &n, &m, &Q);
  for (int i = 1; i <= n; i++)
    scanf("%d", &v[i]), pai[i] = i, vec[i].push_back(i);
  for (int i = 1; i <= m; i++)
    scanf("%d %d", &grafo[i].first, &grafo[i].second);
  for (int i = 1; i <= Q; i++) {
    scanf("%d %d", &q[i].first, &q[i].second);
    if (q[i].first == 2) are[q[i].second] = true;
  }
  for (int i = 1; i <= m; i++) {
    if (are[i] == true) continue;
    int a = grafo[i].first, b = grafo[i].second;
    if (find(a) == find(b)) continue;
    join(a, b);
  }
  vector<pair<int, int>> res;
  for (int i = Q; i >= 1; i--) {
    if (q[i].first == 1) {
      int a = find(q[i].second);
      res.push_back({a, vec[a].size()});
    } else {
      int a = find(grafo[q[i].second].first),
          b = find(grafo[q[i].second].second);
      if (a == b) continue;
      join(a, b);
    }
  }
  for (int i = 1; i < n; i++) {
    if (find(i) == find(i + 1)) continue;
    join(i, i + 1);
  }
  if (n > 100) return 0;
  int h = find(1);
  for (int i = 0; i < n; i++) p[vec[h][i]] = i + 1, st.up(i + 1, v[vec[h][i]]);
  for (int i = (int)res.size() - 1; i >= 0; i--) {
    pair<int, int> h =
        st.get(p[res[i].first], p[res[i].first] + res[i].second - 1);
    printf("%d\n", h.first);
    st.up(h.second, 0);
  }
}
