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;
vector<pair<int, int> > v, queries;
vector<int> adj[1000009];
int val[200009];
int neww, tree[4000009], qvalue[1000009], visited[1000009], endd[1000009], k,
    p[2000009], n, m, q, present[300009], parent[1000009];
void update(int node, int start, int endd, int ind, int val) {
  if (start == endd) {
    tree[node] = val;
    return;
  }
  int mid = (start + endd) / 2;
  if (ind <= mid)
    update(2 * node, start, mid, ind, val);
  else {
    update(2 * node + 1, mid + 1, endd, ind, val);
  }
  tree[node] = max(tree[2 * node], tree[2 * node + 1]);
}
int query(int node, int start, int endd, int l, int r) {
  if (start > endd || l > r || start > r || endd < l) return 0;
  if (start >= l && endd <= r) return tree[node];
  int mid = (start + endd) / 2;
  return max(query(2 * node, start, mid, l, r),
             query(2 * node + 1, mid + 1, endd, l, r));
}
void dfs(int i) {
  if (visited[i]) return;
  visited[i] = endd[i] = ++neww;
  update(1, 1, k, visited[i], p[i]);
  for (int j = 0; j < adj[i].size(); j++) {
    dfs(adj[i][j]);
    endd[i] = max(endd[i], endd[adj[i][j]]);
  }
}
int root(int i) {
  while (parent[i] != i) {
    parent[i] = parent[parent[i]];
    i = parent[i];
  }
  return i;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    val[p[i]] = i;
    parent[i] = i;
  }
  for (int i = n + 1; i <= 1000000; i++) parent[i] = i;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  k = n + 1;
  for (int i = 1; i <= q; i++) {
    int x, y;
    cin >> x >> y;
    queries.push_back({x, y});
    if (x == 2) present[y] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (present[i] == 0) {
      int p1 = root(v[i - 1].first), p2 = root(v[i - 1].second);
      if (p1 != p2) {
        adj[k].push_back(p1);
        adj[k].push_back(p2);
        parent[p1] = parent[p2] = k;
        k++;
      }
    }
  }
  for (int i = q - 1; i >= 0; i--) {
    if (queries[i].first == 2) {
      int p1 = root(v[queries[i].second - 1].first),
          p2 = root(v[queries[i].second - 1].second);
      if (p1 != p2) {
        adj[k].push_back(p1);
        adj[k].push_back(p2);
        parent[p1] = parent[p2] = k;
        qvalue[i] = k;
        k++;
      }
    } else {
      int tt = queries[i].second;
      int pita = root(tt);
      qvalue[i] = pita;
    }
  }
  for (int i = k - 1; i >= 1; i--) {
    if (!visited[i]) dfs(i);
  }
  for (int i = 0; i < q; i++) {
    if (queries[i].first == 1) {
      int l = visited[qvalue[i]];
      int r = endd[qvalue[i]];
      int ans = query(1, 1, k, l, r);
      if (ans) {
        update(1, 1, k, visited[val[ans]], 0);
      }
      cout << ans << "\n";
    }
  }
  return 0;
}
