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 F[200007];
bool valid_edges[300007];
set<int> res[200007];
int Find(int a) {
  if (a == F[a]) return F[a];
  for (auto i : res[a]) res[F[a]].insert(i);
  return F[a] = Find(F[a]);
}
void Union(int a, int b) {
  a = Find(a);
  b = Find(b);
  F[a] = b;
  for (auto i : res[a]) res[b].insert(i);
  for (auto i : res[b]) res[a].insert(i);
}
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 1, a; i <= n; i++) {
    cin >> a;
    res[i].insert(a);
    F[i] = i;
  }
  vector<pair<int, int>> edges(m + 1);
  for (int i = 1; i <= m; i++) {
    cin >> edges[i].first >> edges[i].second;
    valid_edges[i] = true;
  }
  vector<pair<int, int>> queries(q);
  for (int i = 0; i < q; i++) {
    cin >> queries[i].first >> queries[i].second;
    if (queries[i].first == 2) valid_edges[queries[i].second] = false;
  }
  for (int i = 1; i <= m; i++)
    if (valid_edges[i]) Union(edges[i].first, edges[i].second);
  int Res[q];
  for (int i = q - 1; i >= 0; i--) {
    if (queries[i].first == 1) {
      int v = queries[i].second;
      v = Find(v);
      Res[i] = v;
    } else {
      int j = queries[i].second;
      int a = edges[j].first, b = edges[j].second;
      Union(a, b);
    }
  }
  vector<bool> valid_number(n + 7, true);
  for (int i = 0; i < q; i++)
    if (queries[i].first == 1) {
      int v = Res[i];
      valid_number[0] = true;
      res[v].insert(0);
      while (valid_number[*(res[v].rbegin())] == false)
        res[v].erase(*(res[v].rbegin()));
      cout << *(res[v].rbegin()) << '\n';
      valid_number[*(res[v].rbegin())] = false;
      res[v].erase(*(res[v].rbegin()));
    }
}
