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;
int a[300005];
int vis[300005 << 1];
int u[300005], v[300005];
int op[300005 << 1], val[300005 << 1];
int fa[300005 << 1], id[300005 << 1];
int getfa(int now) { return fa[now] == now ? now : fa[now] = getfa(fa[now]); }
int tot, cnt = n;
int to[300005 << 2], nex[300005 << 2], head[300005 << 1];
void add(int x, int y) {
  to[++tot] = y;
  nex[tot] = head[x];
  head[x] = tot;
}
int l[300005 << 1], r[300005 << 1], dfn[300005 << 1];
int dat1[300005 << 3], dat2[300005 << 3];
void pushup(int now) {
  if (dat1[(now << 1)] < dat1[((now << 1) | 1)])
    dat1[now] = dat1[((now << 1) | 1)], dat2[now] = dat2[((now << 1) | 1)];
  else
    dat1[now] = dat1[(now << 1)], dat2[now] = dat2[(now << 1)];
}
void update(int ql, int val, int nl, int nr, int now) {
  if (nl == nr) {
    dat1[now] = val;
    dat2[now] = nl;
    return;
  }
  if (ql <= ((nl + nr) >> 1))
    update(ql, val, nl, ((nl + nr) >> 1), (now << 1));
  else
    update(ql, val, ((nl + nr) >> 1) + 1, nr, ((now << 1) | 1));
  pushup(now);
}
void dfs(int now, int fa) {
  vis[now] = 1;
  dfn[now] = ++tot;
  l[now] = tot;
  if (now <= n) update(tot, a[now], 1, cnt, 1);
  for (int i = head[now]; i; i = nex[i])
    if (to[i] != fa) dfs(to[i], now);
  r[now] = tot;
}
pair<int, int> query(int ql, int qr, int nl, int nr, int now) {
  if (ql <= nl && nr <= qr) return {dat1[now], dat2[now]};
  pair<int, int> ans = {-1, -1};
  if (ql <= ((nl + nr) >> 1))
    ans = max(ans, query(ql, qr, nl, ((nl + nr) >> 1), (now << 1)));
  if (((nl + nr) >> 1) < qr)
    ans = max(ans, query(ql, qr, ((nl + nr) >> 1) + 1, nr, ((now << 1) | 1)));
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), fa[i] = 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", &op[i], &val[i]);
    if (op[i] == 2) vis[val[i]] = 1;
  }
  for (int i = 1; i <= m; i++)
    if (!vis[i]) {
      int xx = getfa(u[i]), yy = getfa(v[i]);
      if (xx != yy) {
        fa[xx] = yy;
        add(u[i], v[i]);
        add(v[i], u[i]);
      }
    }
  cnt = n;
  for (int i = q; i >= 1; i--) {
    if (op[i] == 1)
      val[i] = getfa(val[i]);
    else {
      int xx = getfa(u[val[i]]), yy = getfa(v[val[i]]);
      if (xx != yy) {
        cnt++;
        fa[xx] = cnt;
        fa[yy] = cnt;
        fa[cnt] = cnt;
        add(cnt, xx);
        add(cnt, yy);
      }
    }
  }
  memset(vis, 0, sizeof(vis));
  tot = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[getfa(i)]) dfs(getfa(i), -1);
  for (int i = 1; i <= q; i++) {
    if (op[i] == 1) {
      pair<int, int> res = query(l[val[i]], r[val[i]], 1, cnt, 1);
      printf("%d\n", res.first);
      update(res.second, 0, 1, cnt, 1);
    }
  }
}
