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];
set<int> s[maxn];
set<int>::iterator it, itl, itr;
struct oper {
  int op, u;
} q[maxq];
inline int find(int x) { return (x == fa[x]) ? x : fa[x] = find(fa[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;
  for (int i = 1; i <= m; i++)
    if (!vis[i]) {
      int u = find(x_[i]), v = find(y_[i]);
      if (u != v) fa[u] = v;
    }
  for (int i = 1; i <= n; i++) s[find(i)].insert(a[i]);
  for (int i = Q; i; i--)
    if (q[i].op == 2) {
      int u = find(x_[q[i].u]), v = find(y_[q[i].u]);
      if (u == v) continue;
      if (s[u].size() > s[v].size()) swap(u, v);
      u_[i] = u, v_[i] = v, fa[u] = v;
      for (it = s[u].begin(); it != s[u].end(); it++) s[v].insert(*it);
    }
  static int sta[maxn], top;
  for (int i = 1; i <= Q; i++)
    if (q[i].op == 1) {
      int u = find(q[i].u);
      if (s[u].empty()) {
        puts("0");
        continue;
      }
      printf("%d\n", *s[u].rbegin());
      s[u].erase(*s[u].rbegin());
    } else if (q[i].op == 2) {
      if (!u_[i]) continue;
      int u = u_[i], v = v_[i];
      fa[u] = u, top = 0;
      for (it = s[u].begin(); it != s[u].end(); it++) {
        itr = s[v].find(*it);
        if (itr == s[v].end())
          sta[++top] = *it;
        else
          s[v].erase(*itr);
      }
      for (; top; top--) s[u].erase(sta[top]);
    }
  return 0;
}
