#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int f[N], sz[N], hed[N], ed, n, m, Q, id[N], opt[N], a[N], u[N], v[N], del[N],
    p[N];
set<pair<int, int> > s[N];
bool ban[N];
struct edge {
  int to, nex;
  bool vis;
  edge(int _ = 0, int __ = 0) : to(_), nex(__), vis(0) {}
} e[N << 1];
inline void add(int u, int v) {
  e[++ed] = edge(v, hed[u]);
  hed[u] = ed;
}
int gfa(int x) { return f[x] ^ x ? (f[x] = gfa(f[x])) : x; }
void merge(int u, int v) {
  u = gfa(u);
  v = gfa(v);
  if (sz[u] >= sz[v]) swap(u, v);
  f[u] = v;
  sz[v] += sz[u];
}
void dfs(int u, int fa, int x, int y) {
  f[u] = x;
  s[y].erase(make_pair(a[u], u));
  s[x].insert(make_pair(a[u], u));
  for (int i = hed[u], v = e[i].to; i; i = e[i].nex, v = e[i].to)
    if ((v ^ fa) && !e[i].vis) dfs(v, u, x, y);
}
int main() {
  scanf("%d%d%d", &n, &m, &Q);
  ed = 1;
  for (int i = (1); i <= (n); ++i) scanf("%d", a + i), f[i] = i, sz[i] = 1;
  for (int i = (1); i <= (m); ++i) scanf("%d%d", u + i, v + i);
  for (int i = (1); i <= (Q); ++i) scanf("%d%d", opt + i, id + i);
  for (int i = (1); i <= (Q); ++i)
    if (opt[i] == 2) ban[id[i]] = 1;
  for (int i = (1); i <= (m); ++i)
    if (gfa(u[i]) ^ gfa(v[i]) && !ban[i])
      merge(u[i], v[i]), add(u[i], v[i]), add(v[i], u[i]);
  for (int i = (Q); i >= (1); --i)
    if (opt[i] == 2 && (gfa(u[id[i]]) ^ gfa(v[id[i]]))) {
      int x = gfa(u[id[i]]), y = gfa(v[id[i]]);
      add(u[id[i]], v[id[i]]), add(v[id[i]], u[id[i]]);
      del[i] = sz[x] < sz[y] ? ed : ed - 1;
      p[i] = sz[x] < sz[y] ? x : y;
      merge(x, y);
    }
  for (int i = (1); i <= (n); ++i) s[gfa(i)].insert(make_pair(a[i], i));
  for (int i = (1); i <= (Q); ++i) {
    if (opt[i] == 1) {
      int u = gfa(id[i]), x = s[u].rbegin()->second;
      printf("%d\n", a[x]);
      a[x] = 0;
      s[u].erase(*s[u].rbegin());
      s[u].insert(make_pair(0, x));
    } else if (del[i]) {
      int x = e[del[i]].to;
      e[del[i]].vis = e[del[i] ^ 1].vis = 1;
      dfs(x, 0, p[i], gfa(x));
    }
  }
  return 0;
}
