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 long long MOD = 1e9 + 7;
const int INF = 2e9;
const long long LINF = 4e18;
const long long delta = 24659;
const int N = 5e5 + 5;
int n, m, q, p[N], par[N], st[N], ft[N];
vector<int> G[N];
pair<int, int> E[N], Q[N], seg[4 * N];
bool rem[N];
int getPar(int x) {
  if (par[x] == x) return x;
  return par[x] = getPar(par[x]);
}
void unite(int x, int y) {
  x = getPar(x);
  y = getPar(y);
  if (x == y) return;
  n++;
  G[n].push_back(x);
  G[n].push_back(y);
  par[x] = n;
  par[y] = n;
  par[n] = n;
}
int dtime;
void dfs(int v) {
  st[v] = dtime++;
  for (int u : G[v]) dfs(u);
  ft[v] = dtime;
}
void update(int x, int val, int id = 1, int l = 0, int r = n) {
  if (x < l || r <= x) return;
  if (r - l == 1) {
    seg[id] = make_pair(val, x);
    return;
  }
  int mid = (l + r) / 2;
  update(x, val, 2 * id, l, mid);
  update(x, val, 2 * id + 1, mid, r);
  seg[id] = max(seg[2 * id], seg[2 * id + 1]);
}
pair<int, int> get(int x, int y, int id = 1, int l = 0, int r = n) {
  if (y <= l || r <= x) return make_pair(-1, -1);
  if (x <= l && r <= y) return seg[id];
  int mid = (l + r) / 2;
  return max(get(x, y, 2 * id, l, mid), get(x, y, 2 * id + 1, mid, r));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    par[i] = i;
  }
  for (int i = 1; i <= m; i++) {
    int v, u;
    scanf("%d %d", &v, &u);
    E[i] = make_pair(v, u);
  }
  for (int i = 1; i <= q; i++) {
    int type, x;
    scanf("%d %d", &type, &x);
    Q[i] = make_pair(type, x);
    if (type == 2) rem[x] = 1;
  }
  for (int i = 1; i <= m; i++)
    if (!rem[i]) {
      unite(E[i].first, E[i].second);
    }
  for (int i = q; i >= 1; i--) {
    if (Q[i].first == 1) {
      Q[i].second = getPar(Q[i].second);
    }
    if (Q[i].first == 2) {
      int v = E[Q[i].second].first, u = E[Q[i].second].second;
      unite(v, u);
    }
  }
  for (int i = 1; i <= n; i++)
    if (par[i] == i) dfs(i);
  for (int i = 1; i <= n; i++) update(st[i], p[i]);
  for (int i = 1; i <= q; i++) {
    int type = Q[i].first, v = Q[i].second;
    if (type == 1) {
      pair<int, int> tmp = get(st[v], ft[v]);
      printf("%d\n", tmp.first);
      update(tmp.second, 0);
    }
  }
}
