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;
using ll = long long;
struct Query {
  int type;
  int v;
  Query() {}
  Query(int type, int v) : type(type), v(v) {}
};
int n, m, q;
vector<int> p;
vector<pair<int, int>> edges;
vector<int> when;
vector<Query> queries;
vector<int> par;
vector<int> sz;
vector<int> each;
vector<set<int>> g;
vector<int> color;
vector<priority_queue<int>> values;
vector<char> deleted;
inline int getPar(int v) { return par[v] == v ? v : par[v] = getPar(par[v]); }
void dfs(int v, int par, int other, int newColor) {
  if (!deleted[v]) values[newColor].push(p[v]);
  color[v] = newColor;
  for (auto u : g[v]) {
    if (u == par) continue;
    dfs(u, v, other, newColor);
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m >> q;
  p.resize(n);
  for (int i = int(0); i < int(n); i++) cin >> p[i];
  edges.resize(m);
  for (int i = int(0); i < int(m); i++) {
    cin >> edges[i].first >> edges[i].second;
    edges[i].first--, edges[i].second--;
  }
  when.resize(m, q);
  for (int i = int(0); i < int(q); i++) {
    int type, v;
    cin >> type >> v;
    v--;
    queries.push_back(Query(type, v));
    if (type == 2) when[v] = i;
  }
  vector<int> ord(m);
  iota((ord).begin(), (ord).end(), 0);
  sort((ord).begin(), (ord).end(),
       [&](int v, int u) { return when[v] > when[u]; });
  par.resize(n);
  iota((par).begin(), (par).end(), 0);
  sz.resize(n, 1);
  g.resize(n);
  vector<int> best(m, -1);
  for (auto i : ord) {
    auto [v, u] = edges[i];
    int vv = getPar(v);
    int uu = getPar(u);
    if (vv == uu) continue;
    if (sz[vv] < sz[uu]) swap(vv, uu), swap(v, u);
    par[uu] = vv;
    sz[vv] += sz[uu];
    best[i] = u;
    g[v].insert(u);
    g[u].insert(v);
  }
  color.resize(n, -1);
  values.resize(n);
  int free = 0;
  each.resize(n, -1);
  for (int i = int(0); i < int(n); i++) {
    int pr = getPar(i);
    if (each[pr] == -1) each[pr] = free++;
    color[i] = each[pr];
    values[color[i]].push(p[i]);
  }
  vector<int> which(n);
  for (int i = int(0); i < int(n); i++) which[p[i] - 1] = i;
  deleted.resize(n);
  for (auto [type, v] : queries) {
    if (type == 1) {
      int col = color[v];
      while (int((values[col]).size())) {
        int v = which[values[col].top() - 1];
        if (color[v] != col || deleted[v])
          values[col].pop();
        else
          break;
      }
      if (int((values[col]).size())) {
        int ans = values[col].top();
        values[col].pop();
        cout << ans << '\n';
        deleted[which[ans - 1]] = 1;
      } else {
        cout << "0\n";
      }
    } else if (type == 2 && best[v] != -1) {
      int who = best[v];
      int other = (edges[v].first ^ edges[v].second ^ who);
      g[who].erase(other);
      g[other].erase(who);
      dfs(who, who, other, free++);
    }
  }
}
