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 int N = 500000 + 9;
int u[N], v[N], opt[N], x[N], t[N];
vector<pair<int, int>> vc;
vector<int> G[N];
struct DSU {
  int p[N], sz[N], sk[N], top;
  void init(int n) {
    for (int i = 1; i <= n; ++i) {
      p[i] = i;
      sz[i] = 1;
    }
  }
  int find(int x) { return x == p[x] ? x : p[x] = find(p[x]); }
  bool funion(int x, int y) {
    int px = find(x), py = find(y);
    if (px == py) return false;
    if (sz[px] < sz[py]) swap(px, py);
    p[py] = px;
    sz[px] += sz[py];
    return true;
  }
} dsu;
int p[N], sz[N], dfn[N], E[N], tot;
void dfs(int u, int p) {
  E[dfn[u] = ++tot] = u;
  sz[u] = 1;
  for (int v : G[u])
    if (v != p) {
      dfs(v, u);
      sz[u] += sz[v];
    }
}
template <int N, typename T>
struct Euler_Tour_Tree {
  int tot, L, R, p[N], lc[N], rc[N], sz[N], sk[N];
  unsigned prior[N];
  T K, val[N], maxp[N];
  mt19937 rnd;
  void init(int n) {
    tot = sz[0] = maxp[0] = 0;
    val[0] = -1;
    memset(p, 0, (n + 5) * sizeof(*p));
    memset(lc, 0, (n + 5) * sizeof(*lc));
    memset(rc, 0, (n + 5) * sizeof(*rc));
    for (int i = 1; i < n + 5; ++i) sz[i] = 1;
  }
  void push_up(int o) {
    int _lc = lc[o], _rc = rc[o];
    sz[o] = sz[_lc] + sz[_rc] + 1;
    maxp[o] = val[maxp[_lc]] > val[maxp[_rc]] ? maxp[_lc] : maxp[_rc];
    if (val[o] > val[maxp[o]]) maxp[o] = o;
  }
  void push_down(int o) {}
  void build(int E[], int A[], int n) {
    for (int i = 1, o = E[i]; i <= n; o = E[++i]) {
      prior[o] = rnd();
      val[o] = A[o];
      maxp[o] = o;
    }
    int rt = 0, top = 0, pre = 0;
    for (int i = 1, o = E[i]; i <= n; o = E[++i]) {
      while (top && prior[o] > prior[sk[top]]) --top;
      if (top)
        rc[p[o] = sk[top]] = o;
      else
        rt = o;
      if (top != pre) p[lc[o] = sk[top + 1]] = o;
      sk[pre = ++top] = o;
    }
    for (int i = 1, o = sk[tot = 1] = rt; i <= n; o = sk[++i]) {
      if (lc[o]) sk[++tot] = lc[o];
      if (rc[o]) sk[++tot] = rc[o];
    }
    for (int i = n; i >= 1; --i) push_up(sk[i]);
  }
  void split(int _ord, int o, int l, int r) {
    if (!o) {
      rc[l] = lc[r] = 0;
    } else {
      push_down(o);
      int ord = _ord + sz[lc[o]] + 1;
      if (ord <= R) {
        p[rc[l] = o] = l;
        split(ord, rc[o], o, r);
      } else {
        p[lc[r] = o] = r;
        split(_ord, lc[o], l, o);
      }
      push_up(o);
    }
  }
  int merge(int l, int r) {
    if (!l) {
      return r;
    } else if (!r) {
      return l;
    } else if (prior[l] > prior[r]) {
      push_down(l);
      push_up(p[rc[l] = merge(rc[l], r)] = l);
      return l;
    } else {
      push_down(r);
      push_up(p[lc[r] = merge(l, lc[r])] = r);
      return r;
    }
  }
  void push_all(int o) {
    if (p[o]) {
      push_all(p[o]);
    }
    push_down(o);
  }
  void update(int o, T _val) {
    push_all(o);
    val[o] = _val;
    while (o) {
      push_up(o);
      o = p[o];
    }
  }
  int move_root(int &o) {
    int ord = 0;
    for (int _p; _p = p[o]; o = _p) {
      if (o == rc[_p]) ord += sz[lc[_p]] + 1;
    }
    return ord;
  }
  int opt1(int o) {
    move_root(o);
    int res = val[o = maxp[o]];
    update(o, 0);
    return res;
  }
  void cut(int o, int L) {
    int ord = move_root(o);
    R = ord + L - 1;
    split(0, o, 0, 0);
    int r = lc[0];
    R = ord - 1;
    split(0, rc[0], 0, 0);
    merge(rc[0], r);
  }
};
Euler_Tour_Tree<N, int> ett;
int main() {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", p + i);
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d", u + i, v + i);
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%d %d", opt + i, x + i);
    if (opt[i] == 2) t[x[i]] = q - i + 1;
  }
  for (int i = 1; i <= m; ++i) {
    vc.push_back({t[i], i});
  }
  sort(vc.begin(), vc.end());
  dsu.init(n);
  for (auto &it : vc) {
    int i = it.second;
    if (dsu.funion(u[i], v[i])) {
      t[i] = 0;
      G[u[i]].push_back(v[i]);
      G[v[i]].push_back(u[i]);
    }
  }
  ett.init(n);
  for (int i = 1; i <= n; ++i) {
    if (!dfn[i]) {
      tot = 0;
      dfs(i, 0);
      ett.build(E, p, tot);
    }
  }
  for (int i = 1; i <= q; ++i) {
    if (opt[i] == 1) {
      printf("%d\n", ett.opt1(x[i]));
    } else {
      if (t[x[i]]) continue;
      int _u = u[x[i]], _v = v[x[i]];
      if (sz[_u] < sz[_v]) swap(_u, _v);
      sz[_u] -= sz[_v];
      ett.cut(_v, sz[_v]);
    }
  }
  return 0;
}
