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 + 7;
int fa[N], a[N], pos[N], size[N], vis[N], u[N], v[N], type[N], X[N], U, V, n, m,
    Q, i, j;
multiset<int> mx[N];
vector<int> q;
void merge(int x, int y, vector<int>& d) {
  if (size[x] > size[y]) swap(x, y);
  fa[x] = y;
  mx[y].insert(*mx[x].rbegin());
  size[y] += size[x];
  d.push_back(x);
}
void clear(int x) {
  int y = fa[x];
  mx[y].erase(mx[y].lower_bound(*mx[x].rbegin()));
  size[y] -= size[x];
  fa[x] = x;
}
int find(int x) {
  while (x != fa[x]) x = fa[x];
  return x;
}
void change(int x) {
  if (!x) return;
  int pre = a[x], now = 0;
  a[x] = 0;
  do {
    int tmppre = *mx[x].rbegin();
    mx[x].erase(mx[x].lower_bound(pre));
    mx[x].insert(now);
    now = *mx[x].rbegin();
    pre = tmppre;
  } while (x != fa[x] && (x = fa[x]));
}
int main() {
  for (scanf("%d%d%d", &n, &m, &Q), i = 1; i <= n; ++i)
    fa[i] = i, size[i] = 1, scanf("%d", &j), a[i] = j, pos[j] = i,
    mx[i].insert(j);
  for (i = 1; i <= m; ++i) scanf("%d%d", u + i, v + i);
  for (i = 1; i <= Q; ++i) {
    scanf("%d%d", type + i, X + i);
    if (type[i] == 2) vis[X[i]] = 1;
  }
  for (i = 1; i <= m; ++i)
    if (!vis[i] && (U = find(u[i])) != (V = find(v[i]))) merge(U, V, q);
  q.clear();
  memset(vis, 0, sizeof(vis));
  for (i = Q; i >= 1; --i)
    if (type[i] == 2 && (U = find(u[X[i]])) != (V = find(v[X[i]])))
      merge(U, V, q), vis[i] = 1;
  for (i = 1; i <= Q; ++i)
    if (type[i] == 1)
      printf("%d\n", j = *mx[find(X[i])].rbegin()), change(pos[j]);
    else if (vis[i])
      clear(q.back()), q.pop_back();
}
