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 ch[200005][2], rev[200005], f[200005], a[200005], mx[200005], mx_id[200005];
int opt[200005], ask[200005];
bool mentioned[200005], important[200005];
struct Edge {
  int u, v;
} e[200005];
inline bool not_root(int x) { return ch[f[x]][0] == x || ch[f[x]][1] == x; }
inline int get_which(int x) { return ch[f[x]][1] == x; }
inline void push_up(int x) {
  mx_id[x] = 0;
  mx[x] = -1e9;
  if (ch[x][0]) {
    if (mx[ch[x][0]] > mx[x]) mx_id[x] = mx_id[ch[x][0]];
    mx[x] = max(mx[x], mx[ch[x][0]]);
  }
  if (ch[x][1]) {
    if (mx[ch[x][1]] > mx[x]) mx_id[x] = mx_id[ch[x][1]];
    mx[x] = max(mx[x], mx[ch[x][1]]);
  }
  if (a[x] > mx[x]) mx_id[x] = x;
  mx[x] = max(mx[x], a[x]);
}
inline void push_rev(int x) {
  swap(ch[x][0], ch[x][1]);
  rev[x] ^= 1;
}
inline void push_down(int x) {
  if (rev[x]) {
    if (ch[x][0]) push_rev(ch[x][0]);
    if (ch[x][1]) push_rev(ch[x][1]);
    rev[x] = 0;
  }
}
inline void rotate(int x) {
  int fa = f[x], gr = f[fa];
  int x_w = get_which(x), son = ch[x][x_w ^ 1];
  if (not_root(fa)) ch[gr][get_which(fa)] = x;
  ch[x][x_w ^ 1] = fa;
  ch[fa][x_w] = son;
  f[son] = fa;
  f[fa] = x;
  f[x] = gr;
  push_up(fa);
  push_up(x);
}
int top, stk[200005];
inline void splay(int x) {
  stk[++top] = x;
  int p = x;
  while (p && not_root(p)) p = f[p], stk[++top] = p;
  while (top) push_down(stk[top]), top--;
  while (not_root(x)) {
    if (not_root(f[x])) rotate(get_which(x) == get_which(f[x]) ? f[x] : x);
    rotate(x);
  }
  push_up(x);
}
inline void access(int x) {
  for (int son = 0, p = x; p; son = p, p = f[p])
    splay(p), ch[p][1] = son, push_up(p);
}
inline void make_root(int x) {
  access(x);
  splay(x);
  push_rev(x);
}
inline int find_root(int x) {
  access(x);
  splay(x);
  while (ch[x][0]) push_down(ch[x][0]), x = ch[x][0];
  splay(x);
  return x;
}
inline void split(int x, int y) {
  make_root(x);
  access(y);
  splay(y);
}
inline void link(int x, int y) {
  make_root(x);
  f[x] = y;
}
inline void cut(int x, int y) {
  split(x, y);
  f[x] = ch[y][0] = 0;
  push_up(y);
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    (x *= 10) += ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  n = read(), m = read(), q = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= m; i++) e[i].u = read(), e[i].v = read();
  for (int i = 1; i <= q; i++) {
    opt[i] = read(), ask[i] = read();
    if (opt[i] == 2) mentioned[ask[i]] = true;
  }
  for (int i = 1; i <= m; i++)
    if (!mentioned[i] && find_root(e[i].u) != find_root(e[i].v))
      link(e[i].u, e[i].v);
  for (int i = q; i >= 1; i--)
    if (opt[i] == 2 && find_root(e[ask[i]].u) != find_root(e[ask[i]].v))
      important[i] = true, link(e[ask[i]].u, e[ask[i]].v);
  for (int i = 1, tmp; i <= q; i++) {
    if (opt[i] == 1) {
      make_root(ask[i]);
      tmp = mx_id[ask[i]];
      printf("%d\n", a[tmp]);
      make_root(tmp);
      a[tmp] = 0;
      push_up(tmp);
    }
    if (opt[i] == 2)
      if (important[i]) cut(e[ask[i]].u, e[ask[i]].v);
  }
  return 0;
}
