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;
template <typename T>
void __read(T& a) {
  cin >> a;
}
template <typename T, typename... Args>
void __read(T& a, Args&... args) {
  cin >> a;
  __read(args...);
}
constexpr long long M7 = 1000000007ll;
constexpr long long M9 = 1000000009ll;
constexpr long long MFFT = 998244353ll;
template <class T>
void outv(T& a) {
  for (auto& x : a) cout << x << ' ';
}
static mt19937 rnd(static_cast<unsigned>(
    chrono::steady_clock::now().time_since_epoch().count()));
auto __fast_io__ = (ios_base::sync_with_stdio(false), cin.tie(nullptr));
int32_t main() {
  long long n, m, q;
  __read(n, m, q);
  vector<long long> p(n);
  for (signed i = 0; i < (n); i++) cin >> p[i];
  vector<pair<long long, long long>> e(m);
  vector<set<long long>> g(n);
  for (auto& [v, u] : e) {
    cin >> v >> u;
    v--, u--;
    g[v].insert(u);
    g[u].insert(v);
  }
  vector<pair<long long, long long>> qr(q);
  for (auto& [t, i] : qr) {
    cin >> t >> i;
    i--;
    t--;
    if (t) {
      auto& [v, u] = e[i];
      g[v].erase(u);
      g[u].erase(v);
    }
  }
  vector<vector<long long>> comp;
  vector<long long> color(n, -1);
  function<void(long long)> dfs = [&](long long v) {
    color[v] = comp.size() - 1;
    comp.back().push_back(v);
    for (auto& u : g[v]) {
      if (color[u] == -1) {
        dfs(u);
      }
    }
  };
  for (long long i = 0; i < n; ++i) {
    if (color[i] == -1) {
      comp.emplace_back();
      dfs(i);
    }
  }
  vector<vector<long long>> z(q);
  for (long long i = q - 1; i >= 0; --i) {
    if (qr[i].first) {
      auto [v, u] = e[qr[i].second];
      if (color[v] != color[u]) {
        if (comp[color[v]].size() > comp[color[u]].size()) {
          swap(v, u);
        }
        z[i] = comp[color[v]];
        long long cc = color[v];
        for (long long w : comp[cc]) {
          color[w] = color[u];
          comp[color[u]].push_back(w);
        }
        comp[cc].clear();
      }
      g[v].insert(u);
      g[u].insert(v);
    }
  }
  vector<priority_queue<pair<long long, long long>>> d;
  color.assign(n, -1);
  function<void(long long)> dfs2 = [&](long long v) {
    color[v] = d.size() - 1;
    d.back().emplace(p[v], v);
    for (long long u : g[v]) {
      if (color[u] == -1) {
        dfs2(u);
      }
    }
  };
  for (long long v = 0; v < n; ++v) {
    if (color[v] == -1) {
      d.emplace_back();
      dfs2(v);
    }
  }
  for (long long j = 0; j < q; ++j) {
    auto& [t, i] = qr[j];
    if (t == 0) {
      long long ind = color[i];
      while (color[d[ind].top().second] != ind) {
        d[ind].pop();
      }
      auto [w, v] = d[ind].top();
      cout << w << '\n';
      p[v] = 0;
      d[ind].pop();
      d[ind].emplace(0, v);
    } else {
      if (!z[j].empty()) {
        d.emplace_back();
        for (auto v : z[j]) {
          color[v] = d.size() - 1;
          d.back().emplace(p[v], v);
        }
      }
    }
  }
  return 0;
}
