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>
using namespace std;
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v);
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) {
  return cout << "(" << p.first << ", " << p.second << ")";
}
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v) {
  cout << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
template <typename A, typename B>
istream &operator>>(istream &cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
void usaco(string filename) {
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
const long double pi = 3.14159265358979323846;
struct dsu {
  int n;
  vector<int> sizes, marks;
  vector<vector<int>> graph;
  void init(int rn) {
    n = rn;
    sizes = vector<int>(n);
    fill(sizes.begin(), sizes.end(), 1);
    marks = vector<int>(n);
    for (int i = 0; i < n; i++) marks[i] = i;
    graph = vector<vector<int>>(n);
  }
  void mark(int m, int node) {
    if (marks[node] == m) return;
    marks[node] = m;
    for (int i : graph[node]) mark(m, i);
  }
  void merge(int a, int b) {
    if (marks[a] == marks[b]) return;
    graph[a].push_back(b);
    graph[b].push_back(a);
    if (sizes[marks[a]] > sizes[marks[b]]) swap(a, b);
    sizes[marks[b]] += sizes[marks[a]];
    sizes[marks[a]] = 0;
    mark(marks[b], a);
  }
  int find(int n) { return marks[n]; }
};
long long n, m, k, q, l, r, x, y, z;
const long long template_array_size = 1e6 + 1600;
int a[template_array_size];
long long b[template_array_size];
long long c[template_array_size];
string second, t;
long long ans = 0;
bool rem[500005];
int comp[500005];
pair<int, int> ed[500005];
pair<int, int> qv[500005];
set<pair<int, int>> vals[500005];
pair<int, int> targ[500005];
vector<pair<int, int>> edges[500005];
dsu d;
void relabel(int v, int compv) {
  if (a[v] != 0) {
    vals[comp[v]].erase(make_pair(a[v], v));
    comp[v] = compv;
    vals[comp[v]].insert(make_pair(a[v], v));
  }
  comp[v] = compv;
  for (pair<int, int> x : edges[v]) {
    if (!rem[x.second] && comp[x.first] != compv) {
      relabel(x.first, compv);
    }
  }
}
void solve(int tc = 0) {
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    cin >> ed[i];
    --ed[i].first;
    --ed[i].second;
  }
  memset(rem, 0, sizeof(rem));
  for (int i = 0; i < q; i++) {
    cin >> qv[i];
    --qv[i].second;
    if (qv[i].first == 2) rem[qv[i].second] = 1;
  }
  d.init(n);
  for (int i = 0; i < m; i++) {
    if (!rem[i]) d.merge(ed[i].first, ed[i].second);
  }
  for (int i = q - 1; i >= 0; i--) {
    if (qv[i].first == 2) {
      pair<long long, long long> e = ed[qv[i].second];
      if (d.marks[e.first] == d.marks[e.second])
        targ[i].first = -1;
      else {
        if (d.sizes[d.marks[e.first]] > d.sizes[d.marks[e.second]])
          swap(e.first, e.second);
        targ[i] = e;
        d.merge(e.first, e.second);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    comp[i] = d.marks[i];
    vals[comp[i]].insert(make_pair(a[i], i));
  }
  memset(rem, 0, sizeof(rem));
  for (int i = 0; i < m; i++) {
    edges[ed[i].first].push_back(make_pair(ed[i].second, i));
    edges[ed[i].second].push_back(make_pair(ed[i].first, i));
  }
  int comp_val = n;
  for (int i = 0; i < q; i++) {
    if (qv[i].first == 1) {
      if (!vals[comp[qv[i].second]].size())
        cout << 0 << '\n';
      else {
        auto it = --vals[comp[qv[i].second]].end();
        cout << it->first << '\n';
        a[it->second] = 0;
        vals[comp[qv[i].second]].erase(it);
      }
    } else {
      rem[qv[i].second] = 1;
      if (targ[i].first != -1) {
        relabel(targ[i].first, comp_val);
        ++comp_val;
      }
    }
  }
}
int main() {
  { ios_base::sync_with_stdio(false); }
  {
    cin.tie(NULL);
    cout.tie(NULL);
  }
  int tc = 1;
  for (int t = 0; t < tc; t++) solve(t);
}
