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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("popcnt")
#pragma GCC target("avx2")
using namespace std;
template <typename T1, typename T2>
inline void mine(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
inline void maxe(T1 &x, T2 y) {
  if (x < y) x = y;
}
ostream &operator<<(ostream &a, const vector<int> &b) {
  for (auto k : b) cout << k << ' ';
  return a;
}
const int MOD = 1000000007;
const int INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const int MX = 500010;
const double EPS = 1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int readChar();
inline int readInt();
template <class T>
inline void writeInt(T x);
inline int readChar() {
  int c = getchar();
  while (c <= 32) c = getchar();
  return c;
}
inline int readInt() {
  int s = 0, c = getchar(), x = 0;
  if (c == '-') s = 1, c = getchar();
  while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getchar();
  return s ? -x : x;
}
template <class T>
inline void writeInt(T x) {
  if (x < 0) putchar('-'), x = -x;
  char s[24];
  int n = 0;
  while (x || !n) s[n++] = '0' + x % 10, x /= 10;
  while (n--) putchar(s[n]);
}
inline void operator delete(void *) {}
vector<int> out[MX];
int from[MX];
int to[MX];
int p[200010];
int arr1[200010];
vector<int> in[200010];
vector<pair<int, int> > edges;
int mda;
int get(int x) {
  if (x == p[x]) return x;
  return p[x] = get(p[x]);
}
void unite(int a, int b) {
  a = get(a);
  b = get(b);
  if (a == b) return;
  if (in[a].size() < in[b].size()) swap(a, b);
  out[mda] = in[b];
  from[mda] = a;
  to[mda] = b;
  in[a].reserve(in[a].size() + in[b].size());
  for (auto &x : in[b]) in[a].push_back(x);
  in[b].resize(0);
  p[b] = a;
}
int arr[MX];
pair<int, int> reqs[MX];
bool ban[MX];
vector<int> her[MX];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, q;
  n = readInt();
  m = readInt();
  q = readInt();
  for (int i = 0; i < n; i++) {
    in[i] = {i};
    p[i] = i;
    arr[i] = readInt();
    arr1[arr[i]] = i;
  }
  edges.resize(m);
  for (int i = 0; i < m; i++) {
    edges[i] = {readInt() - 1, readInt() - 1};
  }
  for (int i = 0; i < q; i++) {
    reqs[i].first = readInt();
    reqs[i].second = readInt();
    --reqs[i].second;
    if (reqs[i].first == 2) ban[reqs[i].second] = 1;
  }
  mda = q;
  for (int i = 0; i < m; i++) {
    if (!ban[i]) {
      unite(edges[i].first, edges[i].second);
    }
  }
  for (mda = q - 1; mda >= 0; --mda) {
    if (reqs[mda].first == 2) {
      int id = reqs[mda].second;
      unite(edges[id].first, edges[id].second);
    }
  }
  for (int i = 0; i < n; i++) {
    her[i].reserve(in[i].size());
    for (auto &x : in[i]) {
      p[x] = i;
      her[i].push_back(arr[x]);
    }
    sort(her[i].begin(), her[i].end());
  }
  for (int i = 0; i < q; i++) {
    if (reqs[i].first == 1) {
      int v = get(reqs[i].second);
      while (her[v].size() && p[arr1[her[v].back()]] != v) {
        her[v].pop_back();
      }
      if (!her[v].size()) {
        cout << "0\n";
        continue;
      }
      int w = her[v].back();
      her[v].pop_back();
      writeInt(w);
      cout << '\n';
      arr[arr1[w]] = 0;
    } else {
      if (out[i].empty()) continue;
      int w = to[i];
      her[w].reserve(out[i].size());
      for (auto &u : out[i]) {
        if (arr[u]) her[w].push_back(arr[u]);
        p[u] = w;
      }
      sort(her[w].begin(), her[w].end());
    }
  }
}
