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;
struct WinnerTree {
  int v[200005 * 4];
  int n;
  void build(int *a, int an) {
    int i;
    for (n = 1; n < an; n *= 2)
      ;
    for (i = 0; i < an; i++) v[n + i] = a[i];
    for (i = an; i < n; i++) v[n + i] = a[0];
    for (i = n - 1; i > 0; i--) v[i] = max(v[i * 2], v[i * 2 + 1]);
  }
  void up(int i, int val) {
    i += n;
    v[i] = val;
    for (i /= 2; i; i /= 2) v[i] = max(v[i * 2], v[i * 2 + 1]);
  }
  int get(int st, int en) {
    int rlt = 0;
    st += n, en += n;
    while (st < en) {
      if (st & 1) rlt = max(rlt, v[st]);
      if (en & 1) rlt = max(rlt, v[en - 1]);
      st = (st + 1) / 2;
      en /= 2;
    }
    return rlt;
  }
} WT;
struct Edge {
  int s, e;
  Edge(int s = 0, int e = 0) : s(s), e(e) {}
  void in() {
    cin >> s >> e;
    s--;
    e--;
  }
} E[300005];
int chk[300005];
struct Data {
  int op, id;
  void in() {
    cin >> op >> id;
    id--;
  }
} Q[500005];
bool chkq[500005];
bool vis[200005];
vector<int> con[200005];
int id[200005], cnt;
vector<int> V[200005];
void find(int u) {
  if (vis[u]) return;
  vis[u] = 1;
  id[u] = cnt;
  V[cnt].push_back(u);
  for (int v : con[u]) find(v);
}
int _id[200005], _cnt;
vector<pair<int, int> > adj[200005];
int ID[500005], Sum = 0;
int find_id(int u) {
  if (_id[u] != u) _id[u] = find_id(_id[u]);
  return _id[u];
}
void _find(int u, int p, int q) {
  if (q != -1) ID[q] = Sum;
  vis[u] = 1;
  Sum += V[u].size();
  assert(Sum <= 200005);
  _id[u] = _cnt++;
  for (pair<int, int> P : adj[u]) {
    int v = P.second;
    int ef = P.first;
    if (v != p) _find(v, u, -ef);
  }
}
int n, m, q;
int p[200005], _p[200005];
set<int> spt;
set<int>::iterator it;
int sz;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < m; i++) {
    E[i].in();
    chk[i] = -1;
  }
  for (int i = 0; i < q; i++) {
    Q[i].in();
    if (Q[i].op == 2) chk[Q[i].id] = i;
  }
  for (int i = 0; i < m; i++)
    if (chk[i] == -1) {
      int s = E[i].s, e = E[i].e;
      con[s].push_back(e);
      con[e].push_back(s);
    }
  sz = 0;
  for (int i = 0; i < n; i++) sz += con[i].size();
  assert(sz <= m * 2);
  for (int i = 0; i < n; i++)
    if (!vis[i]) {
      find(i);
      cnt++;
    }
  sz = 0;
  for (int i = 0; i < cnt; i++) sz += V[i].size();
  assert(sz == n);
  for (int i = 0; i < cnt; i++) _id[i] = i, vis[i] = 0;
  for (int i = q - 1; i >= 0; i--)
    if (Q[i].op == 2) {
      int j = Q[i].id;
      int s = id[E[j].s], e = id[E[j].e];
      int u = find_id(s), v = find_id(e);
      if (u == v) {
        chkq[i] = 1;
        continue;
      }
      _id[v] = u;
      adj[s].push_back({-i, e});
      adj[e].push_back({-i, s});
    }
  sz = 0;
  for (int i = 0; i < cnt; i++) sz += adj[i].size();
  assert(sz <= m * 2);
  for (int i = 0; i < cnt; i++) sort(adj[i].begin(), adj[i].end());
  for (int i = 0; i < cnt; i++)
    if (!vis[i]) {
      _find(i, -1, -1);
      spt.insert(Sum);
    }
  for (int i = 0; i < cnt; i++) V[i].clear();
  for (int i = 0; i < n; i++) id[i] = _id[id[i]];
  for (int i = 0; i < n; i++) V[id[i]].push_back(i);
  sz = 0;
  for (int i = 0; i < cnt; i++) sz += V[i].size();
  assert(sz == n);
  int _n = 0;
  for (int i = 0; i < cnt; i++) {
    for (int v : V[i]) _id[v] = _n++;
  }
  for (int i = 0; i < n; i++) _p[_id[i]] = p[i];
  for (int i = 0; i < n; i++) p[_p[i]] = i;
  WT.build(_p, _n);
  sz = spt.size();
  assert(sz <= n * 2);
  int u, s, e, ans;
  for (int i = 0; i < q; i++)
    if (!chkq[i]) {
      if (Q[i].op == 1) {
        u = _id[Q[i].id];
        it = spt.upper_bound(u);
        e = *it;
        if (it == spt.begin())
          s = 0;
        else {
          it--;
          s = *it;
        }
        ans = WT.get(s, e);
        cout << ans << endl;
        WT.up(p[ans], 0);
      }
      if (Q[i].op == 2) spt.insert(ID[i]);
      sz = spt.size();
      assert(sz <= n * 2);
    }
  return 0;
}
