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;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  run();
  return 0;
}
struct FAU {
  Vi G;
  FAU(int n = 0) : G(n, -1) {}
  int size(int i) { return -G[find(i)]; }
  int find(int i) { return G[i] < 0 ? i : G[i] = find(G[i]); }
  bool join(int i, int j) {
    i = find(i);
    j = find(j);
    if (i == j) return 0;
    if (G[i] > G[j]) swap(i, j);
    G[i] += G[j];
    G[j] = i;
    return 1;
  }
};
Vi vals;
vector<Vi> G;
vector<Pii> edges;
vector<bool> on;
Vi comp, flag;
vector<Vi> verts;
int cnt;
void sortVerts(Vi& vec) {
  sort((vec).begin(), (vec).end(),
       [&](int l, int r) { return vals[l] < vals[r]; });
}
int popVal(int c) {
  while (!verts[c].empty()) {
    int v = verts[c].back();
    verts[c].pop_back();
    if (comp[v] == c) {
      int ret = vals[v];
      vals[v] = 0;
      return ret;
    }
  }
  return 0;
}
int dst(int v, int e) {
  if (!on[e]) return -1;
  return edges[e].first == v ? edges[e].second : edges[e].first;
}
void dfs(int v, int p, int c) {
  comp[v] = c;
  verts[c].push_back(v);
  for (auto& e : (G[v])) {
    int u = dst(v, e);
    if (u != p) dfs(u, v, c);
  }
}
void cut(int cut1, int cut2) {
  queue<int> q1, q2;
  Vi vec1, vec2;
  cnt++;
  flag[cut1] = cnt;
  flag[cut2] = cnt;
  q1.push(cut1);
  q2.push(cut2);
  while (true) {
    if (q1.empty()) {
      break;
    }
    if (q2.empty()) {
      q2.swap(q1);
      vec1.swap(vec2);
      break;
    }
    {
      int v = q1.front();
      q1.pop();
      vec1.push_back(v);
      for (int i = (0); i < (int((G[v]).size())); i++) {
        int& e = G[v][i];
        int u = dst(v, e);
        if (u == -1) {
          e = G[v].back();
          G[v].pop_back();
          i--;
          continue;
        }
        if (flag[u] != cnt) {
          q1.push(u);
          flag[u] = cnt;
        }
      }
    }
    {
      int v = q2.front();
      q2.pop();
      vec2.push_back(v);
      for (int i = (0); i < (int((G[v]).size())); i++) {
        int& e = G[v][i];
        int u = dst(v, e);
        if (u == -1) {
          e = G[v].back();
          G[v].pop_back();
          i--;
          continue;
        }
        if (flag[u] != cnt) {
          q2.push(u);
          flag[u] = cnt;
        }
      }
    }
  }
  verts.push_back(move(vec1));
  for (auto& v : (verts.back())) {
    comp[v] = int((verts).size()) - 1;
  }
  sortVerts(verts.back());
}
void run() {
  int n, m, q;
  cin >> n >> m >> q;
  vals.resize(n);
  for (auto& v : (vals)) cin >> v;
  edges.resize(m);
  for (auto& e : (edges)) {
    cin >> e.first >> e.second;
    e.first--;
    e.second--;
  }
  vector<Pii> queries(q);
  vector<bool> used(m);
  for (auto& e : (queries)) {
    cin >> e.first >> e.second;
    e.second--;
    if (e.first == 2) {
      used[e.second] = 1;
    }
  }
  for (int i = (0); i < (m); i++) {
    if (!used[i]) {
      queries.push_back({2, i});
    }
  }
  FAU fau(n);
  q = int((queries).size());
  on.resize(m);
  G.resize(n);
  for (int i = q - 1; i >= 0; i--) {
    auto& e = queries[i];
    if (e.first == 2) {
      if (fau.join(edges[e.second].first, edges[e.second].second)) {
        on[e.second] = 1;
        G[edges[e.second].first].push_back(e.second);
        G[edges[e.second].second].push_back(e.second);
      }
    }
  }
  comp.resize(n, -1);
  for (int i = (0); i < (n); i++) {
    if (comp[i] == -1) {
      verts.emplace_back();
      dfs(i, -1, int((verts).size()) - 1);
      sortVerts(verts.back());
    }
  }
  flag.resize(n, 0);
  cnt = 1;
  for (auto& e : (queries)) {
    if (e.first == 1) {
      cout << popVal(comp[e.second]) << '\n';
    } else {
      if (on[e.second]) {
        on[e.second] = 0;
        cut(edges[e.second].first, edges[e.second].second);
      }
    }
  }
}
