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;
const long long mod = 1e9 + 7;
long long fpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long minm(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long maxm(long long a, long long b) {
  if (a > b) {
    return a;
  } else
    return b;
}
int PHI(int k) {
  int ans = k;
  for (int i = 2; i * i <= k; ++i) {
    if (k % i == 0) {
      ans -= ans / i;
      while (k % i == 0) {
        k /= i;
      }
    }
  }
  if (k > 1) ans -= ans / k;
  return ans;
}
const int N = 2e5 + 5;
vector<int> par(N);
vector<int> Mxs[N];
vector<bool> used(N, false);
vector<int> val(N);
vector<int> deg(N, 0);
int findset(int a) {
  if (a == par[a]) {
    return a;
  }
  return (par[a] = findset(par[a]));
}
void merge_sets(int a, int b) {
  a = findset(a);
  b = findset(b);
  if (a != b) {
    if (a > b) swap(a, b);
    par[b] = a;
    sort(Mxs[a].begin(), Mxs[a].end());
    sort(Mxs[b].begin(), Mxs[b].end());
    vector<int> tmp(Mxs[a].size() + Mxs[b].size());
    merge(Mxs[a].begin(), Mxs[a].end(), Mxs[b].begin(), Mxs[b].end(),
          tmp.begin());
    Mxs[a] = tmp;
  }
}
void solve() {
  int n, m, q, i;
  cin >> n >> m >> q;
  vector<pair<int, int> > egdes(m);
  vector<int> p(n + 1);
  for (i = 1; i <= n; i++) {
    par[i] = i;
  }
  for (i = 1; i <= n; i++) {
    cin >> p[i];
    Mxs[i].push_back(p[i]);
    val[p[i]] = i;
  }
  for (i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    deg[a]++;
    deg[b]++;
    merge_sets(a, b);
    egdes[i] = {a, b};
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    if (x == 1) {
      if (deg[y] == 0) {
        if (used[y]) {
          cout << "0\n";
        } else {
          cout << p[y] << "\n";
          used[y] = 1;
        }
      } else {
        int rep = findset(y);
        if (Mxs[rep].empty()) {
          cout << "0\n";
        } else {
          int d = Mxs[rep].back();
          cout << d << "\n";
          used[val[d]] = 1;
          Mxs[rep].pop_back();
          p[val[d]] = 0;
        }
      }
    } else {
      --y;
      int n1 = egdes[y].first, n2 = egdes[y].second;
      deg[n1]--;
      deg[n2]--;
      int rep = findset(n1);
      if (deg[n1] == 0) {
        auto it = lower_bound(Mxs[rep].begin(), Mxs[rep].end(), p[n1]);
        if (p[n1] && it != Mxs[rep].end() && *it == p[n1]) Mxs[rep].erase(it);
      }
      if (deg[n2] == 0) {
        auto it = lower_bound(Mxs[rep].begin(), Mxs[rep].end(), p[n2]);
        if (p[n2] && it != Mxs[rep].end() && *it == p[n2]) Mxs[rep].erase(it);
      }
    }
  }
}
signed main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int _ = 1;
  for (int test_case = 1; test_case <= _; ++test_case) {
    solve();
  }
}
