#include <bits/stdc++.h>
long long int mod = 2000000000 + 7;
long long int inf = (long long int)(1e18);
using namespace std;
mt19937 unlucko(chrono::steady_clock::now().time_since_epoch().count());
set<int, greater<int> > s[int(2e5)];
vector<int> a(int(2e5)), sz(int(2e5)), p(int(2e5));
vector<bool> used(int(3e5), false);
vector<pair<int, int> > e, q;
void fills() {
  for (int i = 0; i < int(2e5); i++) sz[i] = 1, p[i] = i;
}
int Link(int a) {
  if (a == p[a]) return a;
  return p[a] = Link(p[a]);
}
void Unite(int a, int b) {
  a = Link(a);
  b = Link(b);
  if (a == b) return;
  if (sz[a] < sz[b]) swap(a, b);
  sz[a] += sz[b];
  p[b] = a;
}
int rLink(int a, vector<pair<int, int> > &rp) {
  if (a == p[a]) return a;
  int ret = rLink(p[a], rp);
  rp.push_back({a, p[a]});
  return p[a] = ret;
}
void rUnite(int a, int b, vector<pair<int, int> > &rval,
            vector<pair<int, int> > &rsz, vector<pair<int, int> > &rp) {
  a = rLink(a, rp);
  b = rLink(b, rp);
  if (a == b) return;
  if (sz[a] < sz[b]) swap(a, b);
  rsz.push_back({a, sz[a]});
  sz[a] += sz[b];
  while (!s[b].empty()) {
    int x = *s[b].begin();
    s[b].erase(s[b].begin());
    rval.push_back({b, x});
    s[a].insert(x);
  }
  rp.push_back({b, b});
  p[b] = a;
}
void rec(int cur) {
  vector<pair<int, int> > rsz, rp, rval;
  if (q[cur].first)
    rUnite(e[q[cur].second].first, e[q[cur].second].second, rval, rsz, rp);
  if (cur) rec(cur - 1);
  if (!q[cur].first) {
    int x = 0, pr = rLink(q[cur].second, rp);
    if (!s[pr].empty()) x = *s[pr].begin();
    cout << x << "\n";
    if (s[pr].find(x) != s[pr].end()) s[pr].erase(s[pr].find(x));
  }
  while (!rval.empty()) {
    int v = rval.back().first, vl = rval.back().second;
    rval.pop_back();
    int pr = rLink(v, rp);
    if (s[pr].find(vl) != s[pr].end())
      s[v].insert(vl), s[pr].erase(s[pr].find(vl));
  }
  while (!rp.empty()) {
    int v = rp.back().first, pr = rp.back().second;
    rp.pop_back();
    p[v] = pr;
  }
  while (!rsz.empty()) {
    int v = rsz.back().first, zs = rsz.back().second;
    rsz.pop_back();
    sz[v] = zs;
  }
}
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(0);
  fills();
  int n, m, t;
  cin >> n >> m >> t;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    --x;
    y--;
    e.push_back({x, y});
  }
  for (int i = 0; i < t; i++) {
    int x, y;
    cin >> x >> y;
    --x;
    y--;
    q.push_back({x, y});
    if (x) used[y] = true;
  }
  for (int i = 0; i < m; i++) {
    if (used[i]) continue;
    Unite(e[i].first, e[i].second);
  }
  for (int i = 0; i < n; i++) {
    s[Link(i)].insert(a[i]);
  }
  rec(t - 1);
}
