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;
const int N = 5e5 + 5;
pair<int, int> mx[N << 1];
int n, m, q;
int p[N], u[N], v[N], b[N], clas[N], x[N], a[N];
int f[N];
inline void push_up(int rt) { mx[rt] = max(mx[rt << 1], mx[rt << 1 | 1]); }
inline void push_down(int rt, int l, int r) {}
void build(int rt, int l, int r) {
  if (l == r) {
    mx[rt] = make_pair(a[l], l);
    return;
  }
  int m = (l + r) >> 1;
  build(rt << 1, l, m);
  build(rt << 1 | 1, m + 1, r);
  push_up(rt);
}
void update(int rt, int l, int r, int p) {
  if (l == r) {
    mx[rt] = make_pair(0, l);
    return;
  }
  push_down(rt, l, r);
  int m = (l + r) >> 1;
  if (p <= m)
    update(rt << 1, l, m, p);
  else
    update(rt << 1 | 1, m + 1, r, p);
  push_up(rt);
}
pair<int, int> query(int rt, int l, int r, int L, int R) {
  if (L <= l && r <= R) return mx[rt];
  push_down(rt, l, r);
  int m = (l + r) >> 1;
  pair<int, int> pr = make_pair(0, 0);
  if (L <= m) pr = max(pr, query(rt << 1, l, m, L, R));
  if (m < R) pr = max(pr, query(rt << 1 | 1, m + 1, r, L, R));
  return pr;
}
int find(int x) {
  if (x == f[x]) return x;
  return f[x] = find(f[x]);
}
int tot = 0, dfs[N];
vector<int> vec[N];
int l[N], r[N], L[N], R[N];
void Dfs(int x) {
  dfs[x] = ++tot;
  int sz = vec[x].size();
  for (int i = 0; i < sz; i++) {
    Dfs(vec[x][i]);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u[i], &v[i]);
    b[i] = 0;
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &clas[i], &x[i]);
    if (clas[i] == 2) {
      b[x[i]] = 1;
    }
  }
  for (int i = 1; i <= n; i++) f[i] = i;
  for (int i = 1; i <= m; i++) {
    if (b[i] == 0) {
      int U = find(u[i]), V = find(v[i]);
      if (U != V) {
        vec[U].push_back(V);
        f[V] = U;
      }
    }
  }
  for (int i = q; i >= 1; i--) {
    if (clas[i] == 2) {
      int U = find(u[x[i]]), V = find(v[x[i]]);
      if (U != V) {
        vec[U].push_back(V);
        f[V] = U;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (f[i] == i) Dfs(i);
  }
  for (int i = 1; i <= n; i++) {
    f[i] = i;
    l[i] = r[i] = dfs[i];
  }
  for (int i = 1; i <= m; i++) {
    if (b[i] == 0) {
      int U = find(u[i]), V = find(v[i]);
      if (U != V) {
        r[U] = r[V];
        f[V] = U;
      }
    }
  }
  for (int i = q; i >= 1; i--) {
    if (clas[i] == 2) {
      int U = find(u[x[i]]), V = find(v[x[i]]);
      if (U != V) {
        r[U] = r[V];
        f[V] = U;
      }
    } else {
      int U = find(x[i]);
      L[i] = l[U], R[i] = r[U];
    }
  }
  for (int i = 1; i <= n; i++) a[dfs[i]] = p[i];
  build(1, 1, n);
  for (int i = 1; i <= q; i++) {
    if (clas[i] == 1) {
      pair<int, int> pr = query(1, 1, n, L[i], R[i]);
      printf("%d\n", pr.first);
      update(1, 1, n, pr.second);
    }
  }
}
