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;
const int N = 2e5 + 100, M = 3e5 + 100, Q = 5e5 + 100;
struct event {
  int from, to;
  vector<int> v;
  event() {
    from = to = -1;
    v = vector<int>();
  }
  event(int from, int to, vector<int> v) : from(from), to(to), v(v) {}
} ev[Q];
pair<int, int> qs[Q], e[M];
vector<pair<int, int> > cmps[N];
bool mark[M];
int par[N], p[N];
vector<int> cmp[N];
int root(int v) { return par[v] = (par[v] == v ? v : root(par[v])); }
void merge(int v, int u, int qI = -1) {
  v = root(v);
  u = root(u);
  if (v == u) return;
  if (cmp[v].size() > cmp[u].size()) swap(v, u);
  if (qI >= 0) ev[qI] = event(v, u, cmp[v]);
  for (auto i : cmp[v]) {
    par[i] = u;
    cmp[u].push_back(i);
  }
}
void undo(int qI) {
  int from = ev[qI].from, to = ev[qI].to;
  if (from == -1) return;
  for (auto v : ev[qI].v) par[v] = from;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    par[i] = i;
    cmp[i] = {i};
  }
  for (int i = 0; i < m; i++) {
    cin >> e[i].first >> e[i].second;
    e[i].first--;
    e[i].second--;
  }
  for (int i = 0; i < q; i++) {
    cin >> qs[i].first >> qs[i].second;
    qs[i].second--;
    if (qs[i].first == 2) mark[qs[i].second] = true;
  }
  for (int i = 0; i < m; i++)
    if (!mark[i]) merge(e[i].first, e[i].second);
  for (int i = q - 1; i >= 0; i--) {
    if (qs[i].first == 1) continue;
    int ind = qs[i].second;
    merge(e[ind].first, e[ind].second, i);
  }
  for (int i = 0; i < n; i++) {
    for (auto j : cmp[i]) cmps[i].push_back(pair<int, int>(p[j], j));
    sort(cmps[i].begin(), cmps[i].end());
  }
  for (int i = 0; i < q; i++) {
    if (qs[i].first == 2) {
      undo(i);
      continue;
    }
    int v = qs[i].second;
    v = root(v);
    while (!cmps[v].empty() &&
           (par[cmps[v].back().second] != v || p[cmps[v].back().second] == 0))
      cmps[v].pop_back();
    if (cmps[v].empty())
      cout << "0\n";
    else {
      int cur = cmps[v].back().second;
      cout << p[cur] << "\n";
      p[cur] = 0;
    }
  }
}
