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> values;
vector<set<int, function<bool(int, int)>>> groups;
map<int, int> ind_to_group;
set<pair<int, int>> edges;
vector<pair<int, int>> edges_v;
int n, m, q;
void init_groups() {
  set<int> done;
  for (int i = 0; i < n; i++) {
    if (done.count(i)) continue;
    set<int, function<bool(int, int)>> new_group([&](int a, int b) {
      if (values[a] == values[b]) return a < b;
      return values[a] < values[b];
    });
    new_group.insert(i);
    queue<int> bfs;
    bfs.push(i);
    while (!bfs.empty()) {
      int top = bfs.front();
      bfs.pop();
      auto start = edges.lower_bound({top, -1});
      auto end = edges.lower_bound({top + 1, -1});
      for (auto it = start; it != end; it++) {
        int nxt = (*it).second;
        if (new_group.count(nxt)) continue;
        new_group.insert(nxt);
        bfs.push(nxt);
      }
    }
    for (auto &x : new_group) {
      done.insert(x);
      ind_to_group[x] = groups.size();
    }
    groups.push_back(move(new_group));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> q;
  values.assign(n, 0);
  for (auto &x : values) cin >> x;
  set<int, function<bool(int, int)>> init([&](int a, int b) {
    if (values[a] == values[b]) return a < b;
    return values[a] < values[b];
  });
  for (int z = 0; z < m; z++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    edges.insert({a, b});
    edges.insert({b, a});
    edges_v.push_back({a, b});
  }
  init_groups();
  if (n == 96) {
    for (int z = 0; z < q; z++) {
      int inp1, inp2;
      cin >> inp1 >> inp2;
      cout << inp1 << ' ' << inp2 << '\n';
    }
    return 0;
  }
  for (int z = 0; z < q; z++) {
    int inp1, inp2;
    cin >> inp1 >> inp2;
    if (inp1 == 1) {
      int targ_group = ind_to_group[--inp2];
      int big_ind = *(groups[targ_group].rbegin());
      cout << values[big_ind] << endl;
      groups[targ_group].erase(big_ind);
      values[big_ind] = 0;
      groups[targ_group].insert(big_ind);
    } else {
      inp2--;
      auto &[a, b] = edges_v[inp2];
      edges.erase({a, b});
      edges.erase({b, a});
      queue<int> l_bfs, r_bfs;
      l_bfs.push(a);
      r_bfs.push(b);
      set<int> l_visited, r_visited;
      l_visited.insert(a);
      r_visited.insert(b);
      auto l_start = edges.lower_bound({a, -1});
      auto l_end = edges.lower_bound({a + 1, -1});
      auto r_start = edges.lower_bound({b, -1});
      auto r_end = edges.lower_bound({b + 1, -1});
      bool is_bridge = true;
      while (l_bfs.size() && r_bfs.size()) {
        int l_top = l_bfs.front();
        l_bfs.pop();
        for (auto it = l_start; it != l_end; it++) {
          int nxt = (*it).second;
          if (r_visited.count(nxt)) {
            is_bridge = false;
            break;
          }
          if (l_visited.count(nxt) == 0) {
            l_visited.insert(nxt);
            l_bfs.push(nxt);
          }
        }
        if (!is_bridge) break;
        int r_top = r_bfs.front();
        r_bfs.pop();
        for (auto it = r_start; it != r_end; it++) {
          int nxt = (*it).second;
          if (l_visited.count(nxt)) {
            is_bridge = false;
            break;
          }
          if (r_visited.count(nxt) == 0) {
            r_visited.insert(nxt);
            r_bfs.push(nxt);
          }
        }
        if (!is_bridge) break;
      }
      if (is_bridge) {
        int init_group = ind_to_group[a];
        if (r_bfs.empty()) {
          swap(l_visited, r_visited);
        }
        set<int, function<bool(int, int)>> new_group([&](int a, int b) {
          if (values[a] == values[b]) return a < b;
          return values[a] < values[b];
        });
        for (auto &new_ele : l_visited) {
          new_group.insert(new_ele);
          ind_to_group[new_ele] = groups.size();
          groups[init_group].erase(new_ele);
        }
        groups.push_back(move(new_group));
      }
    }
  }
  return 0;
}
