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;
namespace FGF {
int n, m, Q;
const int N = 5e5 + 5;
int bel[N], a[N], siz[N], fa[N];
vector<int> g[N];
struct edg {
  int u, v;
} e[N];
struct ques {
  int op, x, u;
} q[N];
bool del[N], vis[N];
int find(int x) {
  while (x != fa[x]) x = fa[x];
  return x;
}
void work() {
  scanf("%d%d%d", &n, &m, &Q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) fa[i] = i, g[i].push_back(a[i]), siz[i] = 1;
  for (int i = 1; i <= m; i++) scanf("%d%d", &e[i].u, &e[i].v);
  for (int i = 1; i <= Q; i++) {
    scanf("%d%d", &q[i].op, &q[i].x);
    if (q[i].op == 2) del[q[i].x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (del[i]) continue;
    int u = find(e[i].u), v = find(e[i].v);
    if (u != v) {
      if (siz[u] < siz[v]) swap(u, v);
      fa[v] = u, siz[u] += siz[v];
      for (int sz = g[v].size(), j = 0; j < sz; j++) g[u].push_back(g[v][j]);
    }
  }
  for (int i = Q; i; i--)
    if (q[i].op == 2) {
      int u = find(e[q[i].x].u), v = find(e[q[i].x].v);
      if (u != v) {
        if (siz[u] < siz[v]) swap(u, v);
        fa[v] = u, siz[u] += siz[v];
        q[i].u = v;
        for (int sz = g[v].size(), j = 0; j < sz; j++) g[u].push_back(g[v][j]);
      }
    }
  for (int i = 1; i <= n; i++)
    sort(g[i].begin(), g[i].end()), bel[a[i]] = find(i);
  for (int i = 1; i <= Q; i++) {
    if (q[i].op == 1) {
      int u = find(q[i].x), ans;
      while (g[u].size() && (bel[g[u].back()] != u || vis[g[u].back()]))
        g[u].pop_back();
      if (g[u].size() == 0) {
        puts("0");
        continue;
      }
      ans = g[u].back();
      g[u].pop_back();
      vis[ans] = 1;
      printf("%d\n", ans);
    } else if (q[i].u) {
      for (int sz = g[q[i].u].size(), j = 0; j < sz; j++)
        bel[g[q[i].u][j]] = q[i].u;
      fa[q[i].u] = q[i].u;
    }
  }
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}
