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 IO {
  char buf[(1 << 20)], *p1, *p2;
  char pbuf[(1 << 20)], *pp;
  IO() : p1(buf), p2(buf), pp(pbuf) {}
  inline char gc() {
    return getchar();
    if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, (1 << 20), stdin);
    return p1 == p2 ? ' ' : *p1++;
  }
  inline bool blank(char ch) {
    return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
  }
  template <class T>
  inline void read(T &x) {
    register double tmp = 1;
    register bool sign = 0;
    x = 0;
    register char ch = gc();
    for (; !(ch >= '0' && ch <= '9'); ch = gc())
      if (ch == '-') sign = 1;
    for (; (ch >= '0' && ch <= '9'); ch = gc()) x = x * 10 + (ch - '0');
    if (ch == '.')
      for (ch = gc(); (ch >= '0' && ch <= '9'); ch = gc())
        tmp /= 10.0, x += tmp * (ch - '0');
    if (sign) x = -x;
  }
  inline void read(char *s) {
    register char ch = gc();
    for (; blank(ch); ch = gc())
      ;
    for (; !blank(ch); ch = gc()) *s++ = ch;
    *s = 0;
  }
  inline void read(char &c) {
    for (c = gc(); blank(c); c = gc())
      ;
  }
  template <class t>
  inline void write(t x) {
    if (x < 0)
      putchar('-'), write(-x);
    else {
      if (x > 9) write(x / 10);
      putchar('0' + x % 10);
    }
  }
} io;
const int mod = 1e9 + 7;
const int mo = 998244353;
const int N = 5e5 + 5;
int n, m, T, a[N], col[N], qx[N], qy[N], fa[N], siz[N];
int ux[N], uy[N], del[N], ok[N];
vector<int> g[N];
struct Node {
  int op, x, qx;
};
Node q[N];
inline int find(int x) { return fa[x] == x ? x : find(fa[x]); }
inline int Query(int x) {
  while (g[x].size() && (col[g[x].back()] != x || ok[g[x].back()]))
    g[x].pop_back();
  if (!g[x].size()) return 0;
  int ans = g[x].back();
  g[x].pop_back(), ok[ans] = 1;
  return ans;
}
signed main() {
  io.read(n), io.read(m), io.read(T);
  for (int i = (1); i <= (n); i++)
    io.read(a[i]), g[i].push_back(a[i]), fa[i] = i, siz[i] = 1;
  for (int i = (1); i <= (m); i++) io.read(ux[i]), io.read(uy[i]);
  for (int i = (1); i <= (T); i++) {
    int opt, x;
    io.read(opt), io.read(x);
    q[i] = (Node){opt, x, 0};
    if (opt == 2) del[x] = 1;
  }
  for (int i = (1); i <= (m); i++)
    if (!del[i]) {
      int fx = find(ux[i]), fy = find(uy[i]);
      if (fx == fy) continue;
      if (siz[fx] > siz[fy]) swap(fx, fy);
      for (int j = (0); j <= ((int)g[fx].size() - 1); j++)
        g[fy].push_back(g[fx][j]);
      fa[fx] = fy, siz[fy] += siz[fx];
    }
  for (int i = (T); i >= (1); i--) {
    int op = q[i].op, x = q[i].x;
    int fx = find(ux[x]), fy = find(uy[x]);
    if (fx == fy || op == 1) continue;
    if (siz[fx] > siz[fy]) swap(fx, fy);
    fa[fx] = fy, siz[fy] += siz[fx], q[i].qx = fx;
    for (int j = (0); j <= ((int)g[fx].size() - 1); j++)
      g[fy].push_back(g[fx][j]);
  }
  for (int i = (1); i <= (n); i++)
    sort(g[i].begin(), g[i].end()), col[a[i]] = find(i);
  for (int i = (1); i <= (T); i++) {
    int op = q[i].op, x = q[i].x;
    if (op == 1)
      io.write(Query(find(x))), puts("");
    else if (q[i].qx) {
      for (int j = (0); j <= (g[q[i].qx].size() - 1); j++)
        col[g[q[i].qx][j]] = q[i].qx;
      fa[q[i].qx] = q[i].qx;
    }
  }
  return 0;
}
