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>
#pragma GCC optimize(3)
using namespace std;
const int Mod = 1e9 + 7;
const int N = 5e5 + 100;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
inline long long dpow(long long a, long long b) {
  long long r = 1, t = a;
  while (b) {
    if (b & 1) r = (r * t) % Mod;
    b >>= 1;
    t = (t * t) % Mod;
  }
  return r;
}
inline long long fpow(long long a, long long b) {
  long long r = 1, t = a;
  while (b) {
    if (b & 1) r = (r * t);
    b >>= 1;
    t = (t * t);
  }
  return r;
}
struct node {
  int id, w;
  bool operator<(const node &oth) const { return w > oth.w; }
};
struct Ask {
  int op, x;
} qi[N];
pair<int, int> eg[N];
set<node> s[N];
int fa[N], sz[N], n, m, q;
int a[N];
bool vis[N];
stack<pair<int, int> > st;
void Init() {
  for (int i = 1; i <= n; i++) fa[i] = i, sz[i] = 1;
}
int Find(int x) {
  while (x != fa[x]) x = fa[x];
  return x;
}
void Merge(int x, int y) {
  x = Find(x);
  y = Find(y);
  if (x == y) {
    st.push({0, 0});
    return;
  }
  if (sz[x] > sz[y]) swap(x, y);
  fa[x] = y;
  st.push({x, y});
  sz[y] += sz[x];
  for (auto it : s[x]) s[y].insert(it);
}
void Cancle() {
  int x = st.top().first, y = st.top().second;
  st.pop();
  if (!x && !y) return;
  fa[x] = x;
  sz[y] -= sz[x];
  for (auto it : s[x]) {
    auto v = it;
    if (s[y].find(v) != s[y].end()) s[y].erase(v);
  }
}
int main() {
  cin >> n >> m >> q;
  Init();
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), s[i].insert({i, a[i]});
  for (int i = 1; i <= m; i++) scanf("%d %d", &eg[i].first, &eg[i].second);
  for (int i = 1; i <= q; i++) {
    scanf("%d %d", &qi[i].op, &qi[i].x);
    if (qi[i].op == 2) vis[qi[i].x] = true;
  }
  for (int i = 1; i <= m; i++)
    if (!vis[i]) Merge(eg[i].first, eg[i].second);
  for (int i = q; i >= 1; i--) {
    if (qi[i].op == 1) continue;
    int u = eg[qi[i].x].first;
    int v = eg[qi[i].x].second;
    Merge(u, v);
  }
  for (int i = 1; i <= q; i++) {
    int op = qi[i].op, x = qi[i].x;
    if (op == 1) {
      int u = Find(x);
      if (s[u].empty()) {
        printf("%d\n", a[u]);
        a[u] = 0;
        continue;
      }
      int v = s[u].begin()->id;
      printf("%d\n", s[u].begin()->w);
      s[u].erase({v, a[v]});
      a[v] = 0;
      s[u].insert({v, a[v]});
    } else
      Cancle();
  }
  return 0;
}
