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;
vector<int> god;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
  }
  return os;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& x : v) is >> x;
  return is;
}
class dsu {
 private:
  int n;
  vector<int> parent;
  vector<vector<int>> component;

 public:
  dsu(int n) {
    this->n = n;
    parent.assign(n, -1);
    component.assign(n, {});
    for (int i = 0; i < n; i++) {
      component[i].push_back(i);
    }
  }
  int find_parent(int v) {
    return parent[v] == -1 ? v : parent[v] = find_parent(parent[v]);
  }
  vector<int>& connect(int u, int v) {
    u = find_parent(u);
    v = find_parent(v);
    if (u == v) return god;
    if (component[u].size() > component[v].size()) {
      swap(u, v);
    }
    for (int x : component[u]) {
      component[v].push_back(x);
    }
    parent[u] = v;
    return component[u];
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> p(n);
  cin >> p;
  for (int i = 0; i < n; i++) p[i]--;
  vector<array<int, 2>> E(m);
  for (int i = 0; i < m; i++) {
    cin >> E[i][0] >> E[i][1];
    E[i][0]--, E[i][1]--;
  }
  vector<array<int, 2>> Q(q);
  for (int i = 0; i < q; i++) {
    cin >> Q[i][0] >> Q[i][1];
    Q[i][1]--;
  }
  auto removed = new vector<bool>(m);
  for (int i = 0; i < q; i++) {
    if (Q[i][0] == 2) {
      (*removed)[Q[i][1]] = true;
    }
  }
  dsu d(n);
  for (int i = 0; i < m; i++) {
    if (!(*removed)[i]) {
      int u = E[i][0];
      int v = E[i][1];
      d.connect(u, v);
    }
  }
  free(removed);
  vector<vector<int>> smaller_component(q);
  for (int i = q - 1; i >= 0; i--) {
    if (Q[i][0] == 2) {
      int u = E[Q[i][1]][0];
      int v = E[Q[i][1]][1];
      smaller_component[i] = d.connect(u, v);
    }
  }
  vector<int> color(n);
  vector<set<array<int, 2>>> color_set(2 * n);
  for (int i = 0; i < n; i++) {
    color[i] = d.find_parent(i);
    color_set[color[i]].insert({p[i], i});
  }
  int first_unusued_color = n;
  for (int i = 0; i < q; i++) {
    if (Q[i][0] == 1) {
      int v = Q[i][1];
      if (color_set[color[v]].empty()) {
        cout << "0\n";
        continue;
      }
      int mx = (*color_set[color[v]].rbegin())[0];
      int u = (*color_set[color[v]].rbegin())[1];
      cout << mx + 1 << '\n';
      color_set[color[v]].erase({mx, u});
      p[u] = -1;
    } else {
      auto& component = smaller_component[i];
      if (component.empty()) continue;
      int past_c = color[component[0]];
      int c = first_unusued_color;
      for (int x : component) {
        color[x] = c;
        if (p[x] != -1) {
          color_set[c].insert({p[x], x});
          color_set[past_c].erase({p[x], x});
        }
      }
      first_unusued_color++;
      component.clear();
    }
  }
  return 0;
}
