#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;
}
