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 = 200005, maxm = 300005, maxq = 500005;
int n, m, q;
int p[maxn], ex[maxm], ey[maxm], t[maxq], x[maxq], f[maxn], tag[maxm],
    ans[maxq], size[maxn], ok[maxq], rec[maxq], del[maxn], bel[maxn];
vector<int> v[maxn];
int find(int x) { return f[x] == x ? x : find(f[x]); }
void merge(int a, int b) {
  a = find(a), b = find(b);
  if (a == b) return;
  if (size[a] > size[b]) swap(a, b);
  f[a] = b, size[b] += size[a];
  for (int i = 0; i < v[a].size(); i++) v[b].push_back(v[a][i]);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    f[i] = i, size[i] = 1, v[i].push_back(p[i]);
  }
  for (int i = 1; i <= m; i++) scanf("%d%d", &ex[i], &ey[i]);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &t[i], &x[i]);
    if (t[i] == 2) tag[x[i]] = 1;
  }
  for (int i = 1; i <= m; i++)
    if (tag[i] == 0) merge(ex[i], ey[i]);
  for (int i = q; i >= 1; i--)
    if (t[i] == 2) {
      int a = find(ex[x[i]]), b = find(ey[x[i]]);
      if (a == b) continue;
      ok[i] = 1, rec[i] = a, merge(a, b);
    }
  for (int i = 1; i <= n; i++) {
    bel[p[i]] = find(i);
    sort(v[i].begin(), v[i].end());
  }
  for (int i = 1; i <= q; i++) {
    if (t[i] == 1) {
      int now = find(x[i]);
      while (v[now].size() &&
             (bel[v[now].back()] != now || del[v[now].back()] == 1))
        v[now].pop_back();
      if (v[now].size() == 0)
        puts("0");
      else {
        del[v[now].back()] = 1;
        printf("%d\n", v[now].back());
        v[now].pop_back();
      }
    }
    if (t[i] == 2) {
      if (ok[i] == 0) continue;
      f[rec[i]] = rec[i];
      for (int j = 0; j < v[rec[i]].size(); j++) bel[v[rec[i]][j]] = rec[i];
    }
  }
  return 0;
}
