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 int SZ = 1 << 19;
char buf[SZ], *ie = buf + SZ, *ip = ie - 1;
inline int in() {
  if (++ip == ie)
    if (fread(ip = buf, 1, SZ, stdin))
      ;
  while (*ip < '-')
    if (++ip == ie)
      if (fread(ip = buf, 1, SZ, stdin))
        ;
  register int x = *ip & 15;
  if (++ip == ie)
    if (fread(ip = buf, 1, SZ, stdin))
      ;
  while (*ip > '-') {
    x *= 10;
    x += *ip & 15;
    if (++ip == ie)
      if (fread(ip = buf, 1, SZ, stdin))
        ;
  }
  return x;
}
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-12;
const double PI = acos(-1.0);
const double angcst = PI / 180.0;
const long long mod = 998244353;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long qmul(long long a, long long b) {
  long long r = 0;
  while (b) {
    if (b & 1) r = (r + a) % mod;
    b >>= 1;
    a = (a + a) % mod;
  }
  return r;
}
long long qpow(long long a, long long n) {
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * a) % mod;
    n >>= 1;
    a = (a * a) % mod;
  }
  return r;
}
long long qpow(long long a, long long n, long long p) {
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * a) % p;
    n >>= 1;
    a = (a * a) % p;
  }
  return r;
}
int n, m, q;
int orid[200050];
int v[200050];
set<int> st[200050];
vector<int> vec[200050];
vector<int> mainvec[200050];
int a[300050], b[300050];
int opr[500050], opid[500050];
bool vis[300050];
int gp[200050];
int fnd(int p) { return p == gp[p] ? p : (gp[p] = fnd(gp[p])); }
void mergeTo(vector<int> &v, int a, int b) {
  a = fnd(a);
  b = fnd(b);
  if (a ^ b) {
    if (vec[a].size() < vec[b].size()) swap(a, b);
    v = vec[a];
    for (int &it : vec[b]) vec[a].push_back(it);
    gp[b] = a;
    vec[a].clear();
  }
}
void solve() {
  n = in(), m = in(), q = in();
  for (int i = (1); i <= (n); i++) {
    v[i] = in();
    orid[v[i]] = i;
    gp[i] = i;
    vec[i].push_back(i);
  }
  for (int i = (1); i <= (m); i++) a[i] = in(), b[i] = in();
  for (int i = (1); i <= (q); i++) {
    opr[i] = in(), opid[i] = in();
    if (opr[i] == 2) vis[opid[i]] = true;
  }
  for (int i = (1); i <= (m); i++) {
    if (!vis[i]) mergeTo(mainvec[0], a[i], b[i]);
  }
  for (int i = (q); i >= (1); i--) {
    if (opr[i] == 2) mergeTo(mainvec[i], a[opid[i]], b[opid[i]]);
  }
  for (int i = (1); i <= (n); i++) {
    if (fnd(i) == i) {
      for (int &it : vec[i]) st[i].insert(v[it]);
    }
  }
  int gpid = n;
  for (int i = (1); i <= (q); i++) {
    if (opr[i] == 1) {
      bool flag = false;
      int fa = fnd(opid[i]);
      while (!st[fa].empty()) {
        auto it = st[fa].rbegin();
        cerr << "? " << fa << ' ' << (*it) << '\n';
        st[fa].erase(*it);
        if (fnd(orid[*it]) == fa) {
          v[orid[*it]] = 0;
          flag = true;
          cout << (*it) << '\n';
          break;
        }
      }
      if (!flag) cout << "0\n";
    } else {
      ++gpid;
      for (int &it : mainvec[i]) {
        gp[it] = gpid;
        if (v[it]) st[gpid].insert(v[it]);
      }
    }
  }
}
int main() {
  solve();
  return 0;
}
