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 = 2e5 + 5;
const int inf = 1e9 + 5;
const int mod = 1e9 + 7;
const int logN = 17;
int wh[N], val[N], size[N], up[N], n, m, k, Q, x, y, last[N + N], par[N + N];
set<int> v[N];
set<int> S[N];
pair<int, int> ed[N * 2];
pair<int, int> q[N * 3];
vector<int> qq[N + N + N + 1];
void merge(int x, int y, int edge) {
  while (up[x] != x) {
    x = up[x];
  }
  while (up[y] != y) {
    y = up[y];
  }
  if (x == y) return;
  if (size[x] < size[y]) swap(x, y);
  par[edge] = y;
  up[y] = x;
  v[x].insert(y);
  for (auto xx : S[y]) {
    S[x].insert(xx);
  }
  size[x] += size[y];
}
void del(int node, int par) {
  int t = par;
  while (val[node]) {
    S[t].erase(val[node]);
    if (t == up[t]) break;
    t = up[t];
  }
  for (auto go : v[node]) {
    del(go, par);
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &Q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &val[i]);
    up[i] = i;
    size[i] = 1;
    wh[val[i]] = i;
    S[i].insert(val[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &ed[i].first, &ed[i].second);
    last[i] = Q + 1;
  }
  for (int i = 1; i <= Q; i++) {
    scanf("%d %d", &q[i].first, &q[i].second);
    if (q[i].first == 2) {
      last[q[i].second] = i;
    }
  }
  for (int i = 1; i <= m; i++) {
    qq[last[i]].push_back(i);
  }
  for (int i = Q + 1; i >= 1; i--) {
    for (auto x : qq[i]) {
      merge(ed[x].first, ed[x].second, x);
    }
  }
  for (int i = 1; i <= Q; i++) {
    if (q[i].first == 2) {
      int par = ::par[q[i].second];
      if (par == 0) continue;
      del(par, up[par]);
      v[up[par]].erase(par);
      up[par] = par;
    } else if (q[i].first == 1) {
      int node = q[i].second;
      while (up[node] != node) node = up[node];
      if (S[node].size()) {
        int nod = wh[*S[node].rbegin()];
        printf("%d\n", val[nod]);
        int t = nod;
        while (1) {
          S[t].erase(val[nod]);
          if (up[t] == t) break;
          t = up[t];
        }
        val[nod] = 0;
      } else {
        printf("0\n");
      }
    }
  }
  return 0;
}
