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>
#include <variant>
#define FOR(i,k,n)  for(int i = (k);i < (n);++i)
#define REP(i,n)    FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;

constexpr int INF = 1e9;

struct UnionFindPP {
  int now;
  vector<pair<int,int>> parent;
  vector<vector<tuple<int,int,int>>> size_his;
  UnionFindPP (int n) : now(0), parent(n, make_pair(INF, -1)), size_his(n, vector(1, make_tuple(0, 1, -1))) {}
  int root(int x, int t) { return t < parent[x].first ? x : root(parent[x].second, t); }
  int size(int x, int t) {
    x = root(x, t);
    auto itr = prev(upper_bound(begin(size_his[x]), end(size_his[x]), make_tuple(t, INF, INF)));
    return get<1>(*itr);
  }
  bool merge(int x, int y) {
    ++now;
    x = root(x, now); y = root(y, now);
    if (x == y) return false;
    int size_x = get<1>(size_his[x].back());
    int size_y = get<1>(size_his[y].back());
    if (size_y > size_x) {
      swap(x, y);
      swap(size_x, size_y);
    }
    size_his[x].emplace_back(now, size_x+size_y, y);
    parent[y] = make_pair(now, x);
    return true;
  }
  template <typename F>
  void dfs(int x, F func) {
    func(x);
    for (auto&& [t, _, child] : size_his[x]) {
      if (t == 0) continue;
      dfs(child, func);
    }
  }
};

struct Edge {
  int src,dest;
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,m,q;
  cin>>n>>m>>q;
  //scanf("%d%d%d", &n, &m, &q);
  vecint p(n);
  REP(i,n) {
    cin>>p[i];
    //scanf("%d", &p[i]);
  }
  vector<Edge> ve;
  ve.reserve(m);
  REP(i,m) {
    int a,b;
    cin>>a>>b;
    //scanf("%d%d", &a, &b);
    --a;--b;
    ve.push_back({a,b});
  }
  vector<tuple<int,int>> vq;
  const int INF = 1e8;
  vecint deleted(m,INF);
  REP(i,q) {
    int t,u;
    cin>>t>>u;
    //scanf("%d%d", &t, &u);
    --u;
    vq.emplace_back(t,u);
    if (t == 2) deleted[u] = i;
  }
  UnionFindPP ufpp(n);
  REP(i,n) {
    auto&&[a,b] = ve[i];
    if (deleted[i] == INF) {
      ufpp.merge(a,b);
    }
  }
  deque<int> vtime;
  vtime.push_back(ufpp.now);
  REP(ri,q) {
    int i = q - ri - 1;
    auto [t,u] = vq[i];
    if (t == 2) {
      auto [a, b] = ve[u];
      ufpp.merge(a, b);
    }
    vtime.push_front(ufpp.now);
  }
  map<int,set<pair<int,int>, std::greater<>>> s;
  REP(i,n) {
    s[ufpp.root(i, ufpp.now)].emplace(p[i], i);
  }
  REP(i,q) {
    auto [t,u] = vq[i];
    if (t == 1) {
      int root = ufpp.root(u, vtime[i]);
      auto itr = begin(s[root]);
      auto [val, idx] = *itr;
      cout << val << "\n";
      //printf("%d\n", val);
      if (val > 0) {
        s[root].erase(itr);
        s[root].emplace(0, idx);
        p[idx] = 0;
      }
    } else {
      auto [a, b] = ve[u];
      a = ufpp.root(a, vtime[i+1]);
      b = ufpp.root(b, vtime[i+1]);
      if (a == b) continue;
      int r = ufpp.root(a, vtime[i]);
      if (r == b) {
        swap(a, b);
      }
      set<pair<int,int>, greater<>> new_b_s;
      auto& a_s = s[a];
      ufpp.dfs(b, [&] (int idx) {
        auto itr = a_s.find(make_pair(p[idx], idx));
        new_b_s.emplace(*itr);
        a_s.erase(itr);
      });
      s[b] = std::move(new_b_s);
    }
  }
  return 0;
}
