#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T>
void _dbg(char const *s, const T &t) {
  cerr << s << "=" << t << endl;
}
template <typename T, typename... TA>
void _dbg(char const *s, const T &t, const TA &...ta) {
  while (*s != ',') cerr << *s++;
  cerr << "=" << t << ",";
  _dbg(s + 1, ta...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream &print_iterable(ostream &os, T beg, T end) {
  os << '[';
  for (auto it = beg; it != end; ++it) {
    if (it != beg) os << ", ";
    os << *it;
  }
  return os << ']';
}
template <typename T, size_t N>
ostream &operator<<(ostream &os, const array<T, N> &x) {
  return print_iterable(os, begin(x), end(x));
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &x) {
  return print_iterable(os, begin(x), end(x));
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &x) {
  return print_iterable(os, begin(x), end(x));
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &x) {
  return print_iterable(os, begin(x), end(x));
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &x) {
  return print_iterable(os, begin(x), end(x));
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &x) {
  return print_iterable(os, begin(x), end(x));
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const unordered_map<T1, T2> &x) {
  return print_iterable(os, begin(x), end(x));
}
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
constexpr int maxn = 2e5 + 1;
constexpr int maxq = 5e5 + 1;
struct DSU {
  int par[maxn];
  int sz[maxn];
  DSU() {
    iota(par, par + maxn, 0);
    fill(sz, sz + maxn, 1);
  }
  int p(int x) {
    if (par[x] == x) return x;
    return par[x] = p(par[x]);
  }
  bool merge(int a, int b) {
    a = p(a);
    b = p(b);
    if (a == b) return false;
    if (sz[a] < sz[b]) {
      swap(a, b);
    }
    sz[a] += sz[b];
    par[b] = a;
    return true;
  }
} dsu;
vector<pii> edges;
vector<bool> edge_will_be_deleted;
vector<int> g[maxn];
vector<pii> qs;
array<set<int>, maxn> setik;
array<pii, maxq> rollbacks;
void solve() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  vector<int> used(n + 1);
  vector<int> p(n);
  for (auto &x : p) {
    scanf("%d", &x);
  }
  edges.resize(m);
  edge_will_be_deleted.resize(m, false);
  for (auto &e : edges) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    e = {a, b};
    g[a].push_back(b);
    g[b].push_back(a);
  }
  qs.resize(q);
  for (auto &e : qs) {
    int t, v;
    scanf("%d%d", &t, &v);
    --v;
    e = {t, v};
    if (t == 2) {
      edge_will_be_deleted[v] = true;
    }
  }
  for (int i = 0; i < m; ++i) {
    if (edge_will_be_deleted[i]) continue;
    int a, b;
    tie(a, b) = edges[i];
    dsu.merge(a, b);
  }
  for (int i = 0; i < n; ++i) {
    int a = dsu.p(i);
    setik[a].insert(p[i]);
  }
  for (int i = q - 1; i >= 0; --i) {
    int t, eid;
    tie(t, eid) = qs[i];
    if (t == 2) {
      int a, b;
      tie(a, b) = edges[eid];
      a = dsu.p(a);
      b = dsu.p(b);
      if (a == b) {
        continue;
      }
      if (dsu.sz[a] < dsu.sz[b]) {
        swap(a, b);
      }
      setik[a].insert(setik[b].begin(), setik[b].end());
      rollbacks[i] = {a, b};
      dsu.merge(a, b);
    }
    if (t == 1) {
      int v = eid;
      v = dsu.p(v);
      rollbacks[i] = {v, 0};
    }
  }
  for (int i = 0; i < q; ++i) {
    int t, v;
    tie(t, v) = qs[i];
    if (t == 2) {
      int a, b;
      tie(a, b) = rollbacks[i];
      if (a == b) continue;
      for (const auto &e : setik[b]) {
        setik[a].erase(e);
      }
      continue;
    }
    int p = rollbacks[i].first;
    int res = 0;
    while (!setik[p].empty()) {
      int r = *setik[p].rbegin();
      if (!used[r]) {
        res = r;
        break;
      }
      setik[p].erase(r);
    }
    used[res] = true;
    ;
    printf("%d\n", res);
  }
}
int main() {
  solve();
  return 0;
}
