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 pr = pair<int, int>;
int N, M, Q, A[200005], par[200005];
pr E[300005], QS[500005];
bool chk[300005];
set<int> s[200005];
stack<pr> st;
int f(int x) { return par[x] = (par[x] == x ? x : f(par[x])); }
void uni(int x, int y) {
  x = f(x), y = f(y);
  if (x == y) return;
  if (s[x].size() > s[y].size()) swap(x, y);
  st.push(pr(x, y));
  for (auto it : s[x]) s[y].insert(it);
  par[x] = y;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> N >> M >> Q;
  iota(par, par + N + 1, 0);
  for (int i = 1; i <= N; i++) cin >> A[i], s[i].insert(A[i]);
  for (int i = 1, x, y; i <= M; i++) {
    cin >> x >> y;
    E[i] = pr(x, y);
  }
  for (int i = 1, x, y; i <= Q; i++) {
    cin >> x >> y;
    QS[i] = pr(x, y);
    if (x == 2) chk[y] = 1;
  }
  for (int i = 1; i <= M; i++)
    if (!chk[i]) uni(E[i].first, E[i].second);
  for (int i = Q; i; i--) {
    if (QS[i].first == 1)
      QS[i].second = f(QS[i].second);
    else {
      int x = E[QS[i].second].first, y = E[QS[i].second].second;
      if (f(x) == f(y))
        QS[i].first = 0;
      else
        uni(x, y);
    }
  }
  for (int i = 1; i <= Q; i++) {
    if (QS[i].first == 1) {
      int p = QS[i].second;
      int ans = 0;
      if (s[p].size() > 0) {
        ans = *s[p].rbegin();
        s[p].erase(ans);
      }
      cout << ans << "\n";
    } else if (QS[i].first == 2) {
      int x = st.top().first, y = st.top().second;
      st.pop();
      set<int> tmp;
      for (auto it : s[x])
        if (s[y].find(it) != s[y].end()) {
          tmp.insert(it);
          s[y].erase(it);
        }
      s[x] = tmp;
    }
  }
}
