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>
const int N = 200010;
const int M = 300010;
const int Q = 500010;
class Graph {
 public:
  Graph() {
    e_.clear();
    e_.push_back(Edge(0, 0, 1));
    m_ = 0;
  }
  Graph(int n) : n_(n) {
    e_.clear();
    e_.push_back(Edge(0, 0, 1));
    m_ = 0;
    hd_.assign(n + 1, 0);
    vis_.assign(n + 1, false);
  }
  void Init(int n) {
    e_.clear();
    e_.push_back(Edge(0, 0, 1));
    m_ = 0;
    n_ = n;
    hd_.assign(n + 1, 0);
    vis_.assign(n + 1, false);
  }
  void Add(int u, int v, long long w = 1ll) {
    Edge edge(v, hd_[u], w);
    e_.push_back(edge);
    hd_[u] = ++m_;
  }
  int Head(int id_v) { return hd_[id_v]; }
  int Next(int id_e) { return e_[id_e].nxt; }
  int To(int id_e) { return e_[id_e].v; }
  long long W(int id_e) { return e_[id_e].w; }
  int NumNode() { return n_; }

 private:
  struct Edge {
    int v, nxt;
    long long w;
    Edge(int _v, int _nxt, long long _w) : v(_v), nxt(_nxt), w(_w) {}
  };
  int n_;
  std::vector<int> hd_;
  int m_;
  std::vector<Edge> e_;
  std::vector<bool> vis_;
} graph;
class UnionFindSet {
 public:
  UnionFindSet() {}
  void Init(int n) {
    n_ = n;
    for (int i = 1; i <= n; ++i) {
      fa[i] = i;
      sz[i] = 1;
      vecs[i].clear();
      vecs[i].push_back(i);
    }
  }
  int Find(int x) {
    if (fa[x] == x) {
      return x;
    }
    int tmp = fa[x];
    fa[x] = Find(fa[x]);
    return fa[x];
  }
  void Union(int a, int b) {
    int fa_a = Find(a);
    int fa_b = Find(b);
    fa[fa_a] = fa_b;
    sz[fa_b] += sz[fa_a];
    for (size_t i = 0; i < vecs[fa_a].size(); ++i) {
      vecs[fa_b].push_back(vecs[fa_a][i]);
    }
  }
  void Out(int u, std::vector<int>& vec) {
    int fa_u = Find(u);
    vec.clear();
    for (size_t i = 0; i < vecs[fa_u].size(); ++i) {
      vec.push_back(vecs[fa_u][i]);
    }
  }
  int Size(int u) {
    int fa_u = Find(u);
    return sz[fa_u];
  }

 private:
  int n_;
  int fa[N];
  int sz[N];
  std::vector<int> vecs[N];
} ufs;
int n, m, q;
int p[N];
int a[M], b[M];
int c[Q], d[Q];
std::vector<int> out[Q];
bool vis_e[M];
bool vis[N];
std::set<std::pair<int, int>> s[M];
int id[N];
int cnt;
void Dfs(int u, int root) {
  vis[u] = true;
  if (u != root) {
    ufs.Union(u, root);
  }
  for (int i = graph.Head(u); i; i = graph.Next(i)) {
    int v = graph.To(i);
    if (!vis[v]) {
      Dfs(v, root);
    }
  }
}
void Dfs2(int u, int cnt) {
  vis[u] = true;
  id[u] = cnt;
  s[cnt].insert(std::pair<int, int>(p[u], u));
  for (int i = graph.Head(u); i; i = graph.Next(i)) {
    int v = graph.To(i);
    if (!vis[v]) {
      Dfs2(v, cnt);
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &p[i]);
    vis[i] = false;
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a[i], &b[i]);
    vis_e[i] = true;
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d", &c[i], &d[i]);
    if (c[i] == 2) {
      vis_e[d[i]] = false;
    }
    out[i].clear();
  }
  graph.Init(n);
  for (int i = 1; i <= m; ++i) {
    if (vis_e[i]) {
      graph.Add(a[i], b[i]);
      graph.Add(b[i], a[i]);
    }
  }
  ufs.Init(n);
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      Dfs(i, i);
    }
  }
  for (int i = q; i >= 1; --i) {
    if (c[i] == 2) {
      int u = a[d[i]];
      int v = b[d[i]];
      int fa_u = ufs.Find(u);
      int fa_v = ufs.Find(v);
      if (fa_u != fa_v) {
        if (ufs.Size(fa_u) < ufs.Size(fa_v)) {
          ufs.Out(fa_u, out[i]);
          ufs.Union(fa_u, fa_v);
        } else {
          ufs.Out(fa_v, out[i]);
          ufs.Union(fa_v, fa_u);
        }
      }
    }
  }
  graph.Init(n);
  for (int i = 1; i <= m; ++i) {
    graph.Add(a[i], b[i]);
    graph.Add(b[i], a[i]);
  }
  cnt = 0;
  for (int i = 1; i <= n; ++i) {
    s[i].clear();
    vis[i] = false;
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      Dfs2(i, ++cnt);
    }
  }
  for (int i = 1; i <= q; ++i) {
    if (c[i] == 1) {
      auto x = s[id[d[i]]].rbegin();
      int u = x->second;
      printf("%d\n", x->first);
      s[id[d[i]]].erase(*x);
      s[id[d[i]]].insert(std::pair<int, int>(0, u));
      p[u] = 0;
    } else {
      if (out[i].size()) {
        ++cnt;
      }
      for (size_t j = 0; j < out[i].size(); ++j) {
        int u = out[i][j];
        s[id[u]].erase(std::pair<int, int>(p[u], u));
        s[cnt].insert(std::pair<int, int>(p[u], u));
        id[u] = cnt;
      }
    }
  }
  return 0;
}
