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 = 3e5 + 5;
const int maxq = 5e5 + 5;
int n, m, q;
int p[maxn];
pair<int, int> way[maxn];
int removed[maxn];
int type[maxq], ask[maxq];
int ord[maxn], head[maxn], sz[maxn];
vector<int> has[maxn], part[maxn], have[maxn], com[maxn];
int szz;
int mycom[maxn], cnt[maxn], taken[maxn];
int findhead(int x) {
  if (head[x] == x) return x;
  return head[x] = findhead(head[x]);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    way[i] = {u, v};
  }
  for (int i = 1; i <= m; i++) removed[i] = q + 1;
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &type[i], &ask[i]);
    if (type[i] == 2) removed[ask[i]] = i;
  }
  for (int i = 1; i <= m; i++) ord[i] = i;
  sort(&ord[1], &ord[m + 1],
       [](int x, int y) { return removed[x] > removed[y]; });
  for (int i = 1; i <= n; i++) {
    head[i] = i;
    sz[i] = 1;
    has[i].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    int x = ord[i];
    int u = way[x].first, v = way[x].second;
    int uu = findhead(u), vv = findhead(v);
    if (uu != vv) {
      if (sz[uu] < sz[vv]) swap(uu, vv);
      head[vv] = uu;
      sz[uu] += sz[vv];
      for (auto t : has[vv]) has[uu].push_back(t);
      part[x] = has[vv];
    }
  }
  for (int i = 1; i <= n; i++) have[findhead(i)].push_back(i);
  for (int x = 1; x <= n; x++) {
    if (!have[x].empty()) {
      ++szz;
      com[szz] = have[x];
      sort(com[szz].begin(), com[szz].end(),
           [](int x, int y) { return p[x] > p[y]; });
      for (auto t : com[szz]) mycom[t] = szz;
    }
  }
  for (int x = 1; x <= m; x++)
    sort(part[x].begin(), part[x].end(),
         [](int x, int y) { return p[x] > p[y]; });
  for (int i = 1; i <= q; i++) {
    int x = ask[i];
    if (type[i] == 1) {
      int num = mycom[x];
      while (cnt[num] < com[num].size() &&
             (mycom[com[num][cnt[num]]] != num || taken[com[num][cnt[num]]]))
        cnt[num]++;
      if (cnt[num] < com[num].size()) {
        taken[com[num][cnt[num]]] = 1;
        printf("%d\n", p[com[num][cnt[num]]]);
        cnt[num]++;
      } else
        printf("0\n");
    } else {
      com[++szz] = part[x];
      for (auto t : com[szz]) mycom[t] = szz;
    }
  }
}
