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 maxn = 6e5 + 1000;
int head[maxn], cnt;
struct edge {
  int u, v, heavy;
  bool bridge, del;
} ori[maxn];
struct gg {
  int u, v, idx, next;
} side[maxn * 2];
void ins(int u, int v, int idx) {
  side[++cnt] = (gg){u, v, idx, head[u]};
  head[u] = cnt;
  side[++cnt] = (gg){v, u, idx, head[v]};
  head[v] = cnt;
}
pair<int, int> op[maxn * 2];
priority_queue<pair<int, int>, vector<pair<int, int> > > data[maxn];
bool side_block[maxn];
int fa[maxn], size[maxn];
int inset[maxn];
int set_cnt, p[maxn];
int get(int x) { return (fa[x] == x) ? x : (fa[x] = get(fa[x])); }
void uni(int x, int y, int idx) {
  if (size[get(x)] > size[get(y)])
    ori[idx].heavy = 1;
  else
    ori[idx].heavy = 2;
  size[get(y)] += size[get(x)];
  fa[get(x)] = get(y);
}
vector<int> mymove;
bool vis[maxn];
void dfs(int u) {
  vis[u] = 1;
  mymove.push_back(u);
  for (int i = head[u]; i; i = side[i].next) {
    int v = side[i].v;
    if (vis[v] || side_block[side[i].idx]) continue;
    dfs(v);
  }
}
void dfs2(int u, int mark) {
  vis[u] = 1;
  inset[u] = mark, data[mark].push(make_pair(p[u], u));
  for (int i = head[u]; i; i = side[i].next) {
    int v = side[i].v;
    if (vis[v]) continue;
    dfs2(v, mark);
  }
}
int main() {
  for (int i = (0), iend = (maxn - 1); i <= iend; i++) fa[i] = i, size[i] = 1;
  ios::sync_with_stdio(0);
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = (1), iend = (n); i <= iend; i++) scanf("%d", &p[i]);
  for (int i = (1), iend = (m); i <= iend; i++) {
    scanf("%d%d", &ori[i].u, &ori[i].v);
    ins(ori[i].u, ori[i].v, i);
  }
  for (int i = (1), iend = (n); i <= iend; i++)
    if (!vis[i]) dfs2(i, ++set_cnt);
  memset(vis, 0, sizeof(vis));
  for (int i = (1), iend = (q); i <= iend; i++) {
    int ty, val;
    scanf("%d%d", &ty, &val);
    op[i] = make_pair(ty, val);
    if (ty == 2) ori[val].del = 1;
  }
  for (int i = (1), iend = (m); i <= iend; i++)
    if (!ori[i].del && get(ori[i].u) != get(ori[i].v))
      uni(ori[i].u, ori[i].v, i);
  for (int i = q; i >= 1; i--) {
    if (op[i].first == 1) continue;
    int id = op[i].second;
    if (get(ori[id].u) != get(ori[id].v))
      uni(ori[id].u, ori[id].v, id), ori[id].bridge = 1;
  }
  for (int i = (1), iend = (q); i <= iend; i++) {
    if (op[i].first == 1) {
      pair<int, int> tmp = data[inset[op[i].second]].top();
      while (inset[tmp.second] != inset[op[i].second])
        data[inset[op[i].second]].pop(), tmp = data[inset[op[i].second]].top();
      data[inset[op[i].second]].pop();
      printf("%d\n", tmp.first);
      tmp.first = 0;
      p[tmp.second] = 0;
      data[inset[op[i].second]].push(tmp);
    } else {
      int idx = op[i].second;
      side_block[idx] = 1;
      if (!ori[idx].bridge) continue;
      mymove.clear();
      dfs((ori[idx].heavy == 2) ? ori[idx].u : ori[idx].v);
      set_cnt++;
      for (int j = 0; j < mymove.size(); j++) {
        int u = mymove[j];
        inset[u] = set_cnt;
        vis[u] = 0;
        data[inset[u]].push(make_pair(p[u], u));
      }
    }
  }
  return 0;
}
