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;
int parent[200005], sizex[200005];
int deletedEdge[300005], smallParent[500005];
pair<int, int> edge[300005];
set<int, greater<int> > S[200005];
vector<int> P[200005], X[500005];
vector<pair<int, int> > query;
int find_parent(int x) {
  if (x == parent[x]) return x;
  return parent[x] = find_parent(parent[x]);
}
void unite(int a, int b) {
  a = find_parent(a);
  b = find_parent(b);
  if (a == b) return;
  if (sizex[a] > sizex[b]) swap(a, b);
  parent[a] = b;
  sizex[b] += sizex[a];
  for (auto p : P[a]) P[b].push_back(p);
  P[a].clear();
}
void storeSmallerComponent(int x, int y, int indx) {
  x = find_parent(x);
  y = find_parent(y);
  if (sizex[x] > sizex[y]) swap(x, y);
  for (auto p : P[x]) X[indx].push_back(p);
  smallParent[indx] = x;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    int p;
    cin >> p;
    P[i].push_back(p);
    parent[i] = i, sizex[i] = 1;
  }
  for (int i = 1; i <= m; i++) cin >> edge[i].first >> edge[i].second;
  for (int i = 0; i < q; i++) {
    int type, x;
    cin >> type >> x;
    query.push_back({type, x});
    if (type == 2) deletedEdge[x] = 1;
  }
  for (int i = 1; i <= m; i++)
    if (!deletedEdge[i]) unite(edge[i].first, edge[i].second);
  for (int i = q - 1; i >= 0; i--) {
    if (query[i].first == 1) continue;
    int indx = query[i].second;
    int x = edge[indx].first, y = edge[indx].second;
    if (find_parent(x) == find_parent(y)) continue;
    storeSmallerComponent(x, y, i);
    unite(x, y);
  }
  for (int i = 1; i <= n; i++) {
    parent[i] = find_parent(i);
    for (auto p : P[i]) S[i].insert(p);
  }
  int color = 1000003;
  for (int i = 0; i < q; i++, color++) {
    if (query[i].first == 1) {
      int root = parent[query[i].second];
      if (S[root].empty())
        cout << 0 << "\n";
      else {
        cout << *S[root].begin() << "\n";
        S[root].erase(S[root].begin());
      }
      continue;
    }
    if (X[i].empty()) continue;
    int originalParent = parent[X[i].back()];
    for (auto x : X[i]) {
      parent[x] = smallParent[i];
      S[parent[x]].insert(x);
      S[originalParent].erase(x);
    }
  }
  return 0;
}
