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 = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
struct UnionFind {
  vector<int> parent;
  UnionFind(int n) : parent(n, -1) {}
  int root(int x) { return parent[x] < 0 ? x : parent[x] = root(parent[x]); }
  bool merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (parent[y] < parent[x]) swap(x, y);
    if (parent[x] == parent[y]) --parent[x];
    parent[y] = x;
    return true;
  }
};
struct Edge {
  int src, dest, idx;
};
using Graph = vector<vector<Edge>>;
int dfs(const Graph& g, const map<int, priority_queue<int>>& mq, int i,
        set<int>& vis, int min_qi) {
  int mx = mq.at(i).top();
  vis.insert(i);
  for (auto&& e : g[i]) {
    if (vis.count(e.dest)) continue;
    if (e.idx < min_qi) continue;
    mx = max(mx, dfs(g, mq, e.dest, vis, min_qi));
  }
  return mx;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vecint p(n);
  for (int i = (0); i < (n); ++i) cin >> p[i];
  vecint invp(n + 1);
  for (int i = (0); i < (n); ++i) {
    invp[p[i]] = i;
  }
  vector<Edge> ve;
  for (int i = (0); i < (m); ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    ve.push_back({a, b, i});
  }
  vector<tuple<int, int>> vq;
  const int INF = 1e8;
  vecint deleted(m, INF);
  for (int i = (0); i < (q); ++i) {
    int t, u;
    cin >> t >> u;
    --u;
    vq.emplace_back(t, u);
    if (t == 2) deleted[u] = i;
  }
  int sq = round(sqrt(q));
  for (int i = (0); i < (sq); ++i) {
    int from = q * i / sq;
    int to = q * (i + 1) / sq;
    UnionFind uf(n);
    for (int j = (0); j < (m); ++j) {
      if (deleted[j] < to) continue;
      uf.merge(ve[j].src, ve[j].dest);
    }
    map<int, priority_queue<int>> mq;
    for (int j = (0); j < (n); ++j) {
      mq[uf.root(j)].push(p[j]);
    }
    vector<vector<Edge>> g(n);
    for (int j = (0); j < (m); ++j) {
      if (deleted[j] < from) continue;
      if (deleted[j] >= to) continue;
      int s = uf.root(ve[j].src), t = uf.root(ve[j].dest);
      if (s == t) continue;
      g[s].push_back({s, t, j});
      g[t].push_back({t, s, j});
    }
    for (int j = (from); j < (to); ++j) {
      auto [t, u] = vq[j];
      if (t == 1) {
        set<int> vis;
        auto ans = dfs(g, mq, uf.root(u), vis, j);
        cout << ans << "\n";
        int idx = invp[ans];
        mq.at(uf.root(idx)).pop();
        p[idx] = 0;
      }
    }
  }
  return 0;
}
