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 maxn = 500005;
const int maxm = 500005;
const int maxq = 500005;
const int inf = 0x3f3f3f3f;
int n, m, Q, a[maxn], fa[maxn], x_[maxm], y_[maxm], u_[maxq], v_[maxq];
bool vis[maxm];
vector<int> s[maxn];
set<int> mp[maxn];
set<int>::iterator it, itl, itr;
struct oper {
  int op, u;
} q[maxq];
inline int find(int x) {
  while (x != fa[x]) x = fa[x];
  return x;
}
inline void merge(int i, int x, int y) {
  int u = find(x), v = find(y);
  if (u == v) return;
  if (s[u].size() > s[v].size()) swap(u, v);
  u_[i] = u, v_[i] = v, fa[u] = v;
  for (auto x : s[u]) s[v].push_back(x);
}
int main() {
  scanf("%d%d%d", &n, &m, &Q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d%d", &x_[i], &y_[i]);
  for (int i = 1; i <= Q; i++) {
    scanf("%d%d", &q[i].op, &q[i].u);
    if (q[i].op == 2) vis[q[i].u] = 1;
  }
  for (int i = 1; i <= n; i++) fa[i] = i, s[i].push_back(a[i]);
  for (int i = 1; i <= m; i++)
    if (!vis[i]) merge(0, x_[i], y_[i]);
  for (int i = Q; i; i--)
    if (q[i].op == 2) merge(i, x_[q[i].u], y_[q[i].u]);
  for (int i = 1; i <= n; i++) mp[find(i)].insert(a[i]), vis[i] = 0;
  for (int i = 1; i <= Q; i++)
    if (q[i].op == 1) {
      int u = find(q[i].u);
      if (mp[u].empty()) {
        puts("0");
        continue;
      }
      int val = *mp[u].rbegin();
      printf("%d\n", val);
      vis[val] = 1, mp[u].erase(val);
    } else if (q[i].op == 2) {
      if (!u_[i]) continue;
      int u = u_[i], v = v_[i];
      fa[u] = u;
      for (int i = 0; i < (int)s[u].size(); i++) s[v].pop_back();
      for (auto x : s[u]) {
        if (!vis[x]) mp[u].insert(x);
        if (mp[v].find(x) != mp[v].end()) mp[v].erase(x);
      }
    }
  return 0;
}
