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;
template <typename T1, typename T2>
inline void mine(T1 &x, const T2 &y) {
  if (y < x) x = y;
}
template <typename T1, typename T2>
inline void maxe(T1 &x, const T2 &y) {
  if (x < y) x = y;
}
ostream &operator<<(ostream &out, const vector<int> &b) {
  for (auto k : b) out << k << ' ';
  return out;
}
const int MOD = 1000000007;
const int INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const int MXN = 200010;
const int MXM = 300010;
const int MXQ = 500010;
const double EPS = 1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int arr[MXM];
int p[MXN];
int it[MXN];
vector<int> in[MXN];
int unite(int a, int b) {
  a = p[a];
  b = p[b];
  if (a == b) return -1;
  if (in[a].size() < in[b].size()) swap(a, b);
  in[a].reserve(in[a].size() + in[b].size());
  for (auto &v : in[b]) {
    p[v] = a;
    in[a].push_back(v);
  }
  return b;
}
bool can[MXM];
pair<int, int> edge[MXM];
int type[MXQ], id[MXQ];
int spl[MXQ];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  for (int i = 0; i < m; ++i) {
    can[i] = 1;
    cin >> edge[i].first >> edge[i].second;
    --edge[i].first;
    --edge[i].second;
  }
  for (int i = 0; i < q; ++i) {
    cin >> type[i] >> id[i];
    --id[i];
    if (type[i] == 2) can[id[i]] = 0;
  }
  for (int i = 0; i < n; ++i) {
    p[i] = i;
    in[i] = {i};
  }
  for (int i = 0; i < m; ++i) {
    if (can[i]) {
      unite(edge[i].first, edge[i].second);
    }
  }
  for (int i = q - 1; i >= 0; --i) {
    if (type[i] == 2) {
      spl[i] = unite(edge[id[i]].first, edge[id[i]].second);
    }
  }
  for (int i = 0; i < n; ++i) {
    sort(in[i].begin(), in[i].end(),
         [&](int a, int b) { return arr[a] > arr[b]; });
  }
  for (int i = 0; i < q; ++i) {
    if (type[i] == 1) {
      int h = p[id[i]];
      while (it[h] < in[h].size() && arr[in[h][it[h]]] == 0) ++it[h];
      if (it[h] == in[h].size()) {
        cout << "0\n";
        continue;
      }
      int u = in[h][it[h]];
      cout << arr[u] << '\n';
      arr[u] = 0;
      ++it[h];
    } else {
      int v = spl[i];
      if (v == -1) continue;
      for (auto &u : in[v]) p[u] = v;
    }
  }
}
