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;
inline void read(int& a) {
  static char c = getchar();
  a = 0;
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) a = a * 10 + c - '0', c = getchar();
  a *= f;
  return;
}
int n, m, q, ti[500010 << 1], w[500010 << 1], fa[500010 << 1];
int fd(int x) {
  printf("%d %d\n", x, fa[x]);
  if (x != fa[x]) fa[x] = fd(fa[x]);
  return fa[x];
}
int fi[500010 << 1], ne[500010 << 2], to[500010 << 2], tot, cnt;
int dfn[500010 << 1], dfcnt, siz[500010 << 1], rev[500010 << 1];
int jp[500010 << 1][21], A[500010], B[500010], type[500010], qr[500010],
    deled[500010];
inline void add(int x, int y) {
  ne[++tot] = fi[x];
  to[tot] = y;
  fi[x] = tot;
}
inline void ad(int x, int y) {
  add(x, y);
  add(y, x);
}
void dfs(int x) {
  for (int i = 1; i <= 20; i++) jp[x][i] = jp[jp[x][i - 1]][i - 1];
  rev[dfn[x] = ++dfcnt] = x;
  siz[x] = 1;
  for (int i = fi[x]; i; i = ne[i]) {
    if (to[i] == jp[x][0]) continue;
    jp[to[i]][0] = x;
    dfs(to[i]);
    siz[x] += siz[to[i]];
  }
}
namespace seg {
int tr[500010 << 3];
inline void up(int now) {
  if (w[tr[now << 1]] > w[tr[now << 1 | 1]])
    tr[now] = tr[now << 1];
  else
    tr[now] = tr[now << 1 | 1];
}
void build(int now = 1, int l = 1, int r = cnt) {
  if (l == r) {
    tr[now] = rev[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(now << 1, l, mid);
  build(now << 1 | 1, mid + 1, r);
  up(now);
}
void upd(int x, int now = 1, int l = 1, int r = cnt) {
  if (l == r) {
    w[tr[now]] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    upd(x, now << 1, l, mid);
  else
    upd(x, now << 1 | 1, mid + 1, r);
  up(now);
}
int qry(int x, int y, int now = 1, int l = 1, int r = cnt) {
  if (x <= l && y >= r) return tr[now];
  int mid = (l + r) >> 1, ans = 0;
  if (x <= mid) {
    int nans = qry(x, y, now << 1, l, mid);
    if (w[nans] > w[ans]) ans = nans;
  }
  if (y > mid) {
    int nans = qry(x, y, now << 1 | 1, mid + 1, r);
    if (w[nans] > w[ans]) ans = nans;
  }
  return ans;
}
}  // namespace seg
using seg::qry;
using seg::upd;
int main() {
  read(n);
  read(m);
  read(q);
  w[0] = -1;
  cnt = n;
  for (int i = 1; i <= n; i++) read(w[i]), ti[i] = q + 1, fa[i] = i;
  for (int i = 1; i <= m; i++) read(A[i]), read(B[i]);
  for (int i = 1; i <= q; i++) {
    read(type[i]);
    read(qr[i]);
    if (type[i] == 2) deled[qr[i]] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (deled[i]) continue;
    int x = fd(A[i]), y = fd(B[i]);
    if (x != y) {
      ++cnt;
      w[cnt] = -1;
      ad(x, cnt);
      ad(y, cnt);
      fa[x] = fa[y] = cnt;
      fa[cnt] = cnt;
      ti[cnt] = q + 1;
    }
  }
  for (int i = q; i; i--) {
    if (type[i] == 2) {
      int x = fd(A[qr[i]]), y = fd(B[qr[i]]);
      if (x != y) {
        ++cnt;
        w[cnt] = -1;
        ad(x, cnt);
        ad(y, cnt);
        fa[x] = fa[y] = cnt;
        fa[cnt] = cnt;
        ti[cnt] = i;
        printf("%d %d\n", fd(A[qr[i]]), fd(B[qr[i]]));
      }
    }
  }
  for (int i = 1; i <= cnt; i++)
    if (fd(i) == i) jp[i][0] = 0, dfs(i);
  seg::build();
  for (int i = 1; i <= q; i++) {
    if (type[i] == 1) {
      int x = qr[i];
      for (int j = 20; ~j; j--)
        if (ti[jp[x][j]] >= i) x = jp[x][j];
      int y = qry(dfn[x], dfn[x] + siz[x] - 1);
      printf("%d\n", w[y]);
      upd(dfn[y]);
    }
  }
  return 0;
}
