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>
int32_t main() {
  int32_t n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  std::vector<int32_t> a(n);
  for (int32_t i = 0; i < n; i++) scanf("%d", &a[i]);
  std::vector<std::pair<int32_t, int32_t>> edges(m);
  for (int32_t i = 0; i < m; i++) {
    scanf("%d%d", &edges[i].first, &edges[i].second);
    --edges[i].first;
    --edges[i].second;
  }
  std::vector<bool> removed(m);
  std::vector<std::pair<int32_t, int32_t>> queries(q);
  for (int32_t i = 0; i < q; i++) {
    scanf("%d%d", &queries[i].first, &queries[i].second);
    --queries[i].second;
    if (queries[i].first == 2) removed[queries[i].second] = true;
  }
  std::vector<int32_t> parent(n, -1);
  auto find = [&](int32_t x) {
    while (0 <= parent[x]) x = parent[x];
    return x;
  };
  std::vector<std::vector<int32_t>> adj(n);
  auto merge = [&](int32_t u, int32_t v) {
    u = find(u), v = find(v);
    if (u == v) return;
    if (parent[u] < parent[v]) std::swap(u, v);
    parent[v] += parent[u];
    adj[v].push_back(u);
    parent[u] = v;
  };
  for (int32_t i = 0; i < m; i++) {
    if (removed[i]) continue;
    merge(edges[i].first, edges[i].second);
  }
  std::vector<int32_t> children;
  for (int32_t i = q; i-- > 0;) {
    if (queries[i].first == 1) {
      int32_t x = find(queries[i].second);
      queries[i].second = x;
      children.push_back(adj[x].empty() ? -1 : adj[x].back());
    } else {
      auto edge = edges[queries[i].second];
      merge(edge.first, edge.second);
    }
  }
  std::reverse(children.begin(), children.end());
  std::vector<std::pair<int32_t, int32_t>> tree;
  tree.reserve(n + n);
  tree.resize(n);
  int32_t stamp = 0;
  std::vector<int32_t> left(n), right(n);
  std::function<void(int32_t)> euler = [&](int32_t u) {
    tree.emplace_back(a[u], stamp);
    left[u] = stamp++;
    for (int32_t v : adj[u]) euler(v);
    right[u] = stamp;
  };
  for (int32_t i = 0; i < n; i++) {
    if (find(i) == i) euler(i);
  }
  for (int32_t i = n; i-- > 1;)
    tree[i] = std::max(tree[i + i], tree[i + i + 1]);
  for (int32_t i = 0, j = 0; i < q; i++) {
    if (queries[i].first == 2) continue;
    int32_t l = left[queries[i].second];
    int32_t r = children[j++];
    r = (r < 0 ? l + 1 : right[r]);
    std::pair<int32_t, int32_t> res;
    for (l += n, r += n; l < r; l /= 2, r /= 2) {
      if (l & 1) res = std::max(res, tree[l++]);
      if (r & 1) res = std::max(tree[--r], res);
    }
    printf("%d\n", res.first);
    int32_t x = res.second + n;
    tree[x].first = 0;
    while (x /= 2) tree[x] = std::max(tree[x + x], tree[x + x + 1]);
  }
  return 0;
}
