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 long long INF = 1e9 + 7, N = 5e5 + 7, M = 5e5 + 7, Q = 5e5 + 7;
long long p[N], u[M], v[M], op[Q], xx[Q], where[N], tmm[Q];
set<pair<long long, long long> > s[N];
void change(long long u, long long val) {
  long long tt = where[u];
  assert(s[tt].count({p[u], u}));
  s[tt].erase({p[u], u});
  p[u] = val;
  s[tt].insert({p[u], u});
}
struct T {
  long long who, from, to;
};
vector<T> ev;
signed main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  ;
  long long n, m, q;
  cin >> n >> m >> q;
  for (long long i = 1; i <= n; i++) {
    cin >> p[i];
  }
  for (long long i = 1; i <= n; i++) {
    where[i] = i;
    s[i].insert({p[i], i});
  }
  for (long long i = 1; i <= m; i++) {
    cin >> u[i] >> v[i];
  }
  for (long long i = 0; i < q; i++) {
    cin >> op[i] >> xx[i];
  }
  for (long long i = q - 1; i >= 0; i--) {
    if (op[i] == 2) {
      tmm[i] = ev.size();
      long long x = u[xx[i]], y = v[xx[i]];
      if (where[x] == where[y]) continue;
      if (s[x].size() > s[y].size()) swap(x, y);
      for (auto e : s[x]) {
        where[e.second] = y;
        s[y].insert(e);
        ev.push_back({e.second, x, y});
      }
      s[x].clear();
    }
  }
  for (long long i = 0; i < q; i++) {
    if (op[i] == 1) {
      pair<long long, long long> p = *s[where[xx[i]]].rbegin();
      cout << p.first << "\n";
      change(p.second, 0);
    } else {
      while (ev.size() > tmm[i]) {
        T e = ev.back();
        assert(s[e.to].count({p[e.who], e.who}));
        s[e.to].erase({p[e.who], e.who});
        s[e.from].insert({p[e.who], e.who});
        where[e.who] = e.from;
        ev.pop_back();
      }
    }
  }
}
