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;
int n, m, q, cur = 1, seg[200005 << 2], a[200005], fa[200005], belong[200005],
             del[200005];
int nl[200005], nr[200005], nid[200005], p[200005], pos[200005];
pair<int, int> e[200005], op[200005], mg[200005];
vector<int> E[200005], ver[200005];
int _find(int x) { return fa[x] == x ? x : fa[x] = _find(fa[x]); }
int _merge(int x, int y) {
  x = _find(x), y = _find(y);
  if (x == y) return false;
  fa[x] = y;
  return true;
}
void build(int rt, int l, int r) {
  if (l == r) {
    seg[rt] = p[l];
    return;
  }
  int m = l + r >> 1;
  build(rt << 1, l, m);
  build(rt << 1 | 1, m + 1, r);
  seg[rt] = max(seg[rt << 1], seg[rt << 1 | 1]);
}
void modify(int rt, int l, int r, int x, int y) {
  if (l == r) {
    seg[rt] = y;
    return;
  }
  int m = l + r >> 1;
  if (x <= m)
    modify(rt << 1, l, m, x, y);
  else
    modify(rt << 1 | 1, m + 1, r, x, y);
  seg[rt] = max(seg[rt << 1], seg[rt << 1 | 1]);
}
int query(int rt, int l, int r, int L, int R) {
  if (L <= l && r <= R) return seg[rt];
  int ret = 0, m = l + r >> 1;
  if (L <= m) ret = max(ret, query(rt << 1, l, m, L, R));
  if (m < R) ret = max(ret, query(rt << 1 | 1, m + 1, r, L, R));
  return ret;
}
void dfs(int now, int fa) {
  nl[now] = cur;
  for (auto it : ver[now])
    pos[p[cur] = a[it]] = cur, a[it] = 0, nid[it] = cur, cur++;
  nr[now] = cur - 1;
  for (auto to : E[now])
    if (to != fa) dfs(to, now);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) fa[i] = i, scanf("%d", a + i);
  for (int i = 1; i <= m; i++) scanf("%d%d", &e[i].first, &e[i].second);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &op[i].first, &op[i].second);
    if (op[i].first == 2) del[op[i].second] = 1;
  }
  for (int i = 1; i <= m; i++)
    if (!del[i]) _merge(e[i].first, e[i].second);
  for (int i = 1; i <= n; i++) ver[belong[i] = _find(i)].push_back(i);
  for (int i = q; i >= 1; i--)
    if (op[i].first == 2) {
      int id = op[i].second;
      if (_merge(e[id].first, e[id].second)) {
        E[belong[e[id].first]].push_back(belong[e[id].second]);
        E[belong[e[id].second]].push_back(belong[e[id].first]);
        mg[i].first = belong[e[id].first];
        mg[i].second = belong[e[id].first];
      }
    }
  set<pair<int, int> > s;
  for (int i = 1; i <= n; i++)
    if (E[i].size() == 1 || E[i].size() == 0 && ver[i].size() > 0)
      if (a[i]) {
        int l = cur;
        dfs(i, i);
        int r = cur - 1;
        s.emplace(l, r);
      }
  build(1, 1, n);
  for (int i = 1; i <= q; i++) {
    if (op[i].first == 1) {
      auto it = s.upper_bound({nid[op[i].second] + 1, 0});
      it--;
      pair<int, int> tmp = *it;
      int ans = query(1, 1, n, tmp.first, tmp.second);
      printf("%d\n", ans);
      if (ans) modify(1, 1, n, pos[ans], 0);
    } else {
      int cut = min(nr[mg[i].first], nr[mg[i].second]);
      if (!cut) continue;
      int ll = min(nl[mg[i].first], nl[mg[i].second]);
      auto tmp = s.upper_bound({ll + 1, 0});
      tmp--;
      int newL1 = tmp->first, newR1 = cut, newL2 = cut + 1, newR2 = tmp->second;
      s.erase(tmp);
      s.emplace(newL1, newR1);
      s.emplace(newL2, newR2);
    }
  }
  return 0;
}
