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;
using Graph = vector<vector<int>>;
set<pair<int, int>> other;
int compsz[200001];
set<pair<int, int>, greater<pair<int, int>>> S[200001];
int P[200001];
void dfs(const Graph& G, int v, int p, vector<int>& sz, vector<char>& used,
         vector<int>& comp, int n) {
  sz[v] = 1;
  comp[v] = n;
  compsz[n]++;
  used[v] = true;
  for (int u : G[v]) {
    if (u == p) continue;
    if (used[u]) {
      other.insert({u, v});
      other.insert({v, u});
      continue;
    }
    dfs(G, u, v, sz, used, comp, n);
    sz[v] += sz[u];
  }
}
void dfs2(const Graph& G, int v, int p, vector<int>& comp, vector<int>& sz,
          int n, int pr) {
  sz[v] = 1;
  compsz[n]++;
  comp[v] = n;
  S[n].insert({P[v], v});
  S[pr].erase({P[v], v});
  for (int u : G[v]) {
    if (u == p) continue;
    if (other.count({u, v})) continue;
    dfs2(G, u, v, comp, sz, n, pr);
    sz[v] += sz[u];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; ++i) cin >> P[i];
  Graph G(n);
  vector<pair<int, int>> edges;
  vector<int> Q;
  vector<pair<int, int>> qedges;
  vector<int> qverts;
  map<pair<int, int>, int> edges_q;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    G[a].push_back(b);
    G[b].push_back(a);
    edges.emplace_back(a, b);
  }
  for (int i = 0; i < q; ++i) {
    int t, v;
    cin >> t >> v;
    --v;
    Q.push_back(t);
    if (t == 1)
      qverts.push_back(v);
    else {
      qedges.push_back(edges[v]);
      edges_q.insert({edges[v], q - i});
      edges_q.insert({{edges[v].second, edges[v].first}, q - i});
    }
  }
  for (int i = 0; i < n; ++i) {
    sort(G[i].begin(), G[i].end(), [&](int u, int v) {
      int u1 = 0, u2 = 0;
      if (edges_q.count({u, i})) u1 = edges_q[{u, i}];
      if (edges_q.count({v, i})) u2 = edges_q[{v, i}];
      return u1 < u2;
    });
  }
  vector<char> used(n, false);
  vector<int> comp(n, 0);
  vector<int> sz(n, 0);
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (!used[i]) {
      dfs(G, i, i, sz, used, comp, cnt);
      ++cnt;
    }
  }
  for (int i = 0; i < n; ++i) {
    S[comp[i]].insert({P[i], i});
  }
  int vind = 0, eind = 0;
  for (int i = 0; i < q; ++i) {
    if (Q[i] == 1) {
      int v = qverts[vind++];
      auto [val, ind] = *S[comp[v]].begin();
      cout << val << "\n";
      P[ind] = 0;
      S[comp[v]].erase(S[comp[v]].begin());
      S[comp[v]].insert({0, ind});
    } else {
      auto [u, v] = qedges[eind++];
      if (other.count({u, v})) {
        continue;
      }
      if (sz[u] < sz[v]) {
        swap(u, v);
      }
      auto sz1 = compsz[comp[v]] - sz[v];
      if (sz1 > sz[v]) {
        compsz[comp[v]] -= sz[v];
        dfs2(G, v, u, comp, sz, cnt, comp[v]);
        ++cnt;
      } else {
        compsz[comp[v]] = sz[v];
        dfs2(G, u, v, comp, sz, cnt, comp[v]);
        ++cnt;
      }
    }
  }
  return 0;
}
