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,unroll-loops,-ffloat-store")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
using namespace std;
const int maxn = 1e5 + 5;
int n, m, q, U[maxn * 3], V[maxn * 3], p[maxn << 1];
int tr[maxn * 5], X[maxn * 5];
int sz[maxn << 1], par[maxn << 1], id[maxn << 1];
bool oke[maxn << 1];
vector<pair<int, int> > node[maxn * 20];
set<int, greater<int> > mys[maxn << 1];
stack<pair<int, int> > st;
deque<int> del;
void readf() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &p[i]);
    id[p[i]] = i;
  }
  for (int i = 1; i <= m; ++i) scanf("%d%d", &U[i], &V[i]);
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d", &tr[i], &X[i]);
    if (tr[i] == 2) {
      oke[X[i]] = 1;
      del.push_front(X[i]);
    }
  }
}
inline int root(int u) {
  while (u != par[u]) u = par[u];
  return u;
}
void join(int u, int v) {
  u = root(u);
  v = root(v);
  if (u == v) return;
  if (sz[u] < sz[v]) swap(u, v);
  for (auto it : mys[v]) mys[u].insert(it);
  st.push(pair<int, int>(u, sz[u]));
  st.push(pair<int, int>(v, par[v]));
  sz[u] += sz[v];
  par[v] = u;
}
void roll() {
  pair<int, int> it = st.top();
  st.pop();
  int v = it.first;
  par[v] = it.second;
  it = st.top();
  st.pop();
  int u = it.first;
  sz[u] = it.second;
  for (auto it : mys[v]) mys[u].erase(it);
}
void solve() {
  for (int i = 1; i <= n; ++i) par[i] = i, mys[i].insert(p[i]);
  for (int i = 1; i <= m; ++i)
    if (oke[i] == 0) {
      join(U[i], V[i]);
    }
  for (int i : del) {
    join(U[i], V[i]);
  }
  for (int i = 1; i <= q; ++i)
    if (tr[i] == 1) {
      int u = root(X[i]);
      if (mys[u].size() == 0) {
        printf("0\n");
        continue;
      } else {
        int tmp = (*mys[u].begin());
        printf("%d\n", tmp);
        u = id[tmp];
        mys[u].erase(tmp);
        while (u != par[u]) {
          u = par[u];
          mys[u].erase(tmp);
        }
      }
    } else
      roll();
}
int main() {
  srand(time(NULL));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  readf();
  solve();
}
