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;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template <class T>
inline bool ckmin(T& a, T b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
inline bool ckmax(T& a, T b) {
  return b > a ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const char nl = '\n';
const int mxN = 5e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;
int n, m, Q, p[mxN], sz[mxN], val[mxN], v[mxN], pos[mxN];
pii e[mxN], q[mxN];
bool done[mxN];
vpii adj[mxN];
set<pii> second[mxN];
void dfs(int u, int par) {
  second[p[u]].erase({v[u], u});
  second[par].insert({v[u], u});
  p[u] = par;
  for (auto& x : adj[u]) {
    if (done[x.second] || p[x.first] == par) continue;
    dfs(x.first, par);
  }
}
int Find(int a) { return p[a] = (a == p[a] ? p[a] : Find(p[a])); }
void merge(int a, int b) {
  a = Find(a);
  b = Find(b);
  if (a == b) return;
  if (sz[a] > sz[b]) swap(a, b);
  sz[b] += sz[a];
  sz[a] = 0;
  p[a] = b;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> Q;
  for (int i = (0); i < (n); i++) {
    p[i] = i;
    sz[i] = 1;
  }
  for (int i = (0); i < (n); i++) cin >> v[i];
  for (int i = (0); i < (m); i++) {
    cin >> e[i].first >> e[i].second, e[i].first--, e[i].second--;
    adj[e[i].first].push_back({e[i].first, i});
    adj[e[i].second].push_back({e[i].second, i});
  }
  for (int i = (0); i < (Q); i++) {
    cin >> q[i].first >> q[i].second;
    q[i].second--;
    if (q[i].first == 2) done[q[i].second] = 1;
  }
  for (int i = (0); i < (m); i++) {
    if (!done[i]) {
      merge(e[i].first, e[i].second);
    }
  }
  for (int i = (Q - 1); i >= (0); i--) {
    if (q[i].first == 2) {
      pii& cur = e[q[i].second];
      val[i] = -1;
      if (Find(cur.first) != Find(cur.second)) {
        val[i] = (sz[cur.first] > sz[cur.second] ? cur.second : cur.first);
        merge(cur.first, cur.second);
      }
    }
  }
  for (int i = (0); i < (n); i++) {
    p[i] = Find(i);
    second[p[i]].insert({v[i], i});
  }
  for (int i = (0); i < (Q); i++) {
    int t = q[i].first;
    int vv = q[i].second;
    if (t == 1) {
      vv = p[vv];
      pii gh = *--second[vv].end();
      second[vv].erase(gh);
      cout << gh.first << nl;
      gh.first = 0;
      v[gh.second] = 0;
      second[vv].insert(gh);
    } else {
      if (val[i] == -1) continue;
      done[i] = 1;
      dfs(val[i], val[i]);
    }
  }
  return 0;
}
