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;
constexpr int maxq = 500000 + 2;
constexpr int maxn = 200000 + 2;
constexpr int maxm = 300000 + 2;
int a[maxm], b[maxm], d[maxm];
int type[maxq], id[maxq];
int pi[maxn], p[maxn];
int vt[maxq + 2], cnt;
vector<int> add[maxq];
pair<int*, int> cp[maxn][2];
vector<int> spv[maxn];
pair<int, int> spp[maxn];
int gp(int u) { return p[u] < 0 ? u : p[u] = gp(p[u]); }
struct cmp {
  bool operator()(const int& x, const int& y) const {
    return pi[x] == pi[y] ? x < y : pi[x] > pi[y];
  };
};
set<int, cmp> mer[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i += 1) cin >> pi[i];
  for (int i = 1; i <= m; i += 1) {
    cin >> a[i] >> b[i];
    d[i] = q + 1;
  }
  for (int i = 1; i <= q; i += 1) {
    cin >> type[i] >> id[i];
    if (type[i] == 2) {
      vt[i] = cnt++;
      d[id[i]] = i;
    }
  }
  for (int i = 1; i <= n; i += 1) {
    p[i] = -1;
    mer[i].insert(i);
  }
  for (int i = 1; i <= m; i += 1) add[d[i]].push_back(i);
  for (int i = q + 1; i >= 1; i -= 1) {
    for (int j : add[i]) {
      int pa = gp(a[j]), pb = gp(b[j]);
      if (pa == pb) {
        type[i] = 0;
        continue;
      }
      if (p[pa] < p[pb]) swap(pa, pb);
      if (i <= q) cp[vt[i]][1] = {&p[pb], p[pb]};
      p[pb] += p[pa];
      if (i <= q) cp[vt[i]][0] = {&p[pa], p[pa]};
      p[pa] = pb;
      if (i <= q) spp[vt[i]] = {pa, pb};
      for (int k : mer[pa]) {
        if (i <= q) spv[vt[i]].push_back(k);
        mer[pb].insert(k);
      }
      mer[pa].clear();
    }
  }
  for (int i = 1; i <= q; i += 1) {
    if (type[i] == 1) {
      int r = gp(id[i]), x = *mer[r].begin();
      mer[r].erase(x);
      cout << pi[x] << "\n";
      pi[x] = 0;
      mer[r].insert(x);
    } else if (type[i] == 2) {
      *cp[vt[i]][0].first = cp[vt[i]][0].second;
      *cp[vt[i]][1].first = cp[vt[i]][1].second;
      for (int x : spv[vt[i]]) {
        mer[spp[vt[i]].second].erase(x);
        mer[spp[vt[i]].first].insert(x);
      }
    }
    continue;
    for (int i = 1; i <= n; i += 1)
      if (mer[i].size()) {
        for (int x : mer[i]) cout << x << " ";
        cout << "; ";
      }
    cout << endl;
  }
  return 0;
}
