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 arr[200050], a, b, c, dsu[400050], m, pos[200050];
bool visit[400050];
pair<int, int> edge[300050], que[500050], bound[400050];
set<int> S;
vector<int> V[400050], ask, seq;
int find(int x) {
  if (dsu[x] != x) return dsu[x] = find(dsu[x]);
  return x;
}
void add_edge(int x, int y) {
  int one = find(x), two = find(y);
  if (one == two) return;
  V[m].push_back(one);
  V[m].push_back(two);
  dsu[m] = m;
  dsu[one] = dsu[two] = m++;
}
void dfs(int now) {
  bound[now].first = seq.size();
  if (now <= a) pos[now] = seq.size();
  seq.push_back(now);
  visit[now] = true;
  for (int x : V[now]) dfs(x);
  bound[now].second = seq.size();
  seq.push_back(now);
}
struct thing {
  int left, right, value;
} seg[400050 << 3];
void build(int left, int right, int m) {
  seg[m].left = left;
  seg[m].right = right;
  if (left == right) {
    if (seq[left] <= a)
      seg[m].value = seq[left];
    else
      seg[m].value = 0;
    return;
  }
  int mid = (left + right) >> 1;
  build(left, mid, m * 2);
  build(mid + 1, right, m * 2 + 1);
  seg[m].value = 0;
  if (seg[m * 2].value) seg[m].value = seg[m * 2].value;
  if (seg[m * 2 + 1].value) {
    if (seg[m].value == 0)
      seg[m].value = seg[m * 2 + 1].value;
    else if (arr[seg[m].value] < arr[seg[m * 2 + 1].value])
      seg[m].value = seg[m * 2 + 1].value;
  }
}
int search(int left, int right, int m) {
  if (left > seg[m].right || right < seg[m].left) return 0;
  if (left <= seg[m].left && seg[m].right <= right) return seg[m].value;
  int res = 0;
  int t1 = search(left, right, m * 2);
  int t2 = search(left, right, m * 2 + 1);
  if (t1) res = t1;
  if (t2) {
    if (!res)
      res = t2;
    else if (arr[res] < arr[t2])
      res = t2;
  }
  return res;
}
void modify(int left, int right, int m) {
  if (left > seg[m].right || right < seg[m].left) return;
  if (seg[m].left == seg[m].right) {
    seg[m].value = 0;
    return;
  }
  modify(left, right, m * 2);
  modify(left, right, m * 2 + 1);
  int res = 0;
  int t1 = seg[m * 2].value, t2 = seg[m * 2 + 1].value;
  if (t1) res = t1;
  if (t2) {
    if (!res)
      res = t2;
    else if (arr[res] < arr[t2])
      res = t2;
  }
  seg[m].value = res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> a >> b >> c;
  for (int i = 1; i <= a; i++) {
    cin >> arr[i];
    dsu[i] = i;
  }
  for (int i = 1; i <= b; i++) cin >> edge[i].first >> edge[i].second;
  for (int i = 0; i < c; i++) {
    cin >> que[i].first >> que[i].second;
    if (que[i].first == 2) S.insert(que[i].second);
  }
  m = a + 1;
  for (int i = 1; i <= b; i++) {
    if (S.count(i)) continue;
    add_edge(edge[i].first, edge[i].second);
  }
  for (int i = c - 1; i >= 0; i--) {
    if (que[i].first == 1) {
      ask.push_back(find(que[i].second));
    } else {
      add_edge(edge[que[i].second].first, edge[que[i].second].second);
    }
  }
  for (int i = 1; i < m; i++) {
    if (visit[find(i)]) continue;
    dfs(find(i));
  }
  build(0, seq.size() - 1, 1);
  reverse(ask.begin(), ask.end());
  for (int x : ask) {
    int ind = search(bound[x].first, bound[x].second, 1);
    if (ind == 0) {
      cout << 0 << '\n';
      continue;
    }
    cout << arr[ind] << '\n';
    modify(pos[ind], pos[ind] + 1, 1);
  }
  return 0;
}
