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 INF = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6 + 10;
const int mod = 1e9 + 7;
const double eps = 1e-6;
int di[8][2] = {{-1, 0},  {1, 0},  {0, -1}, {0, 1},
                {-1, -1}, {-1, 1}, {1, -1}, {1, 1}};
clock_t _st = clock();
inline double now_time() { return (double)(clock() - _st) / CLOCKS_PER_SEC; }
inline long long rd() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
long long n, m, q;
long long a[maxn];
set<long long> se[maxn];
set<long long> sa;
pair<long long, long long> p[maxn];
long long ask(long long x) {
  while (se[x].size()) {
    if (sa.count(*(se[x].rbegin()))) {
      se[x].erase(--se[x].end());
      continue;
    }
    long long ans = *(se[x].rbegin());
    sa.insert(*(se[x].rbegin()));
    se[x].erase(--se[x].end());
    return ans;
  }
  return 0;
}
void del(long long x, long long y) {
  if (se[x].count(a[y])) se[x].erase(a[y]);
}
signed main() {
  n = rd(), m = rd(), q = rd();
  for (long long i = 1; i <= n; i++) {
    a[i] = rd();
    se[i].insert(a[i]);
  }
  for (long long i = 1; i <= m; i++) {
    long long u = rd(), v = rd();
    p[i] = {u, v};
    se[u].insert(a[v]);
    se[v].insert(a[v]);
  }
  while (q--) {
    if (rd() == 1) {
      printf("%d\n", ask(rd()));
    } else {
      long long c = rd();
      long long x = p[c].first, y = p[c].second;
      del(x, y);
      del(y, x);
    }
  }
}
