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 = 5e5 + 100;
int p[maxn];
pair<int, int> g[maxn];
map<int, int> mp;
pair<int, int> Q[maxn];
set<pair<int, int>> st[maxn];
bool vis[maxn];
struct UFS {
  int rt[maxn], sz[maxn];
  void init() {
    for (int i = 0; i < maxn; i++) rt[i] = i, sz[i] = 1;
  }
  int Find(int x) {
    while (x != rt[x]) x = rt[x];
    return x;
  }
  void Merge(int x, int y, stack<pair<int, int>>& stk) {
    x = Find(x), y = Find(y);
    if (x == y) {
      stk.push({0, 0});
      return;
    }
    if (sz[x] > sz[y]) swap(x, y);
    for (auto it : st[x]) {
      if (!vis[it.second]) st[y].insert(it);
    }
    rt[x] = y, sz[y] += sz[x];
    stk.push({x, y});
  }
  void Cancel(stack<pair<int, int>>& stk) {
    if (!stk.empty()) {
      int x = stk.top().first, y = stk.top().second;
      stk.pop();
      if (x == y && x == 0) return;
      set<pair<int, int>> stt;
      for (auto it : st[x]) {
        if (st[y].find(it) != st[y].end()) {
          st[y].erase(it);
          if (!vis[it.second]) stt.insert(it);
        }
      }
      st[x].clear();
      st[x] = stt;
      rt[x] = x, sz[y] -= sz[x];
    }
  }
} ufs;
stack<pair<int, int>> stk;
int main() {
  ufs.init();
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    st[i].insert({p[i], i});
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &g[i].first, &g[i].second);
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &Q[i].first, &Q[i].second);
    if (Q[i].first == 2) mp[Q[i].second] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (mp.count(i) == 0) ufs.Merge(g[i].first, g[i].second, stk);
  }
  for (int i = q; i >= 1; i--) {
    if (Q[i].first == 2)
      ufs.Merge(g[Q[i].second].first, g[Q[i].second].second, stk);
  }
  for (int i = 1; i <= q; i++) {
    if (Q[i].first == 1) {
      int x = ufs.Find(Q[i].second);
      if (st[x].size() == 0) {
        puts("0");
        continue;
      }
      auto it = st[x].end();
      --it;
      int flag = 0;
      while (!flag) {
        if (!vis[(*it).second]) {
          flag = (*it).first;
          vis[(*it).second] = 1;
          st[x].erase(it);
          break;
        } else {
          if (it == st[x].begin())
            break;
          else
            it--;
        }
      }
      printf("%d\n", flag);
    } else {
      ufs.Cancel(stk);
    }
  }
  return 0;
}
