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>
int n, m, q, vis[500005], u[500005], v[500005], T[500005], p[500005], d[500005],
    opt[500005], cnt;
std::vector<std::pair<int, int> > rec[500005];
std::vector<int> G[500005];
std::set<std::pair<int, int> > S[500005];
std::vector<int> ch[500005];
void dfs(int x) {
  vis[x] = cnt;
  for (int v : ch[x])
    if (!vis[v]) dfs(v);
}
int read() {
  char c = getchar();
  int x = 0;
  while (c < '0' || c > '9') c = getchar();
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x;
}
void merge(int a, int b, int i) {
  a = vis[a];
  b = vis[b];
  if (a == b) return;
  if (G[a].size() < G[b].size()) std::swap(a, b);
  for (int x : G[b]) {
    rec[i].push_back(std::make_pair(x, vis[x]));
    vis[x] = a;
    G[a].push_back(x);
  }
  G[b].clear();
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) p[i] = read();
  for (int i = 1; i <= m; ++i) {
    u[i] = read();
    v[i] = read();
  }
  for (int i = 1; i <= q; ++i) {
    opt[i] = read();
    d[i] = read();
    if (opt[i] == 2) T[d[i]] = i;
  }
  for (int i = 1; i <= m; ++i)
    if (!T[i]) {
      ch[u[i]].push_back(v[i]);
      ch[v[i]].push_back(u[i]);
    }
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      ++cnt;
      dfs(i);
    }
  }
  for (int i = 1; i <= n; ++i) G[vis[i]].push_back(i);
  for (int i = q; i >= 1; i--) {
    if (opt[i] == 2) merge(u[d[i]], v[d[i]], i);
  }
  for (int i = 1; i <= n; ++i) S[vis[i]].insert(std::make_pair(p[i], i));
  for (int i = 1; i <= q; ++i) {
    for (auto x : rec[i]) {
      int a = x.first, b = x.second;
      S[vis[a]].erase(std::make_pair(p[a], a));
      vis[a] = b;
      S[b].insert(std::make_pair(p[a], a));
    }
    if (opt[i] == 2)
      continue;
    else {
      if (S[vis[d[i]]].empty()) {
        printf("%d\n", 0);
        continue;
      }
      auto x = *S[vis[d[i]]].rbegin();
      S[vis[d[i]]].erase(x);
      printf("%d\n", x.first);
      p[x.second] = 0;
    }
  }
  return 0;
}
