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 = 500010;
int n, m, q, tot, u[maxn], v[maxn], p[maxn], fa[maxn], ans[maxn], cnt[maxn];
struct query {
  int op, x;
} a[maxn];
bool vis1[maxn], vis2[maxn];
set<int> G[maxn];
set<pair<int, int>> S[500010];
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", &p[i]);
  }
  for (int i = 1; i <= n + m; i++) {
    fa[i] = i;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &u[i], &v[i]);
    fa[find(u[i])] = find(v[i]);
    G[u[i]].insert(v[i]), G[v[i]].insert(u[i]);
  }
  for (int i = 1; i <= n; i++) {
    S[find(i)].insert({p[i], i});
  }
  int tot = n;
  for (int i = 1, op, x; i <= q; i++) {
    scanf("%d %d", &op, &x);
    if (op == 1) {
      x = find(x);
      auto it = --S[x].end();
      printf("%d\n", it->first);
      p[it->second] = 0;
      S[x].erase(it), S[x].insert({0, it->second});
    } else {
      G[u[x]].erase(v[x]), G[v[x]].erase(u[x]);
      vector<int> V1, V2;
      V1.push_back(u[x]), V2.push_back(v[x]);
      vis1[u[x]] = vis2[v[x]] = 1;
      bool flag = 0;
      int pos1 = 0, pos2 = 0;
      auto it1 = G[u[x]].begin(), it2 = G[v[x]].begin();
      auto extend1 = [&]() {
        for (; pos1 < V1.size(); pos1++) {
          int v = V1[pos1];
          while (it1 != G[v].end()) {
            if (vis2[*it1]) {
              flag = 1, it1++;
              return;
            }
            if (!vis1[*it1]) {
              V1.push_back(*it1), vis1[*it1] = 1, it1++;
              return;
            }
            it1++;
          }
          if (pos1 < V1.size() - 1) it1 = G[V1[pos1 + 1]].begin();
        }
      };
      auto extend2 = [&]() {
        for (; pos2 < V2.size(); pos2++) {
          int v = V2[pos2];
          while (it2 != G[v].end()) {
            if (vis1[*it2]) {
              flag = 1, it2++;
              return;
            }
            if (!vis2[*it2]) {
              V2.push_back(*it2), vis2[*it2] = 1, it2++;
              return;
            }
            it2++;
          }
          if (pos2 < V2.size() - 1) it2 = G[V2[pos2 + 1]].begin();
        }
      };
      while (!flag && pos1 < V1.size() && pos2 < V2.size()) {
        if (!flag && pos1 < V1.size() && pos2 < V2.size()) extend1();
        if (!flag && pos1 < V1.size() && pos2 < V2.size()) extend2();
      }
      for (int x : V1) vis1[x] = 0;
      for (int x : V2) vis2[x] = 0;
      if (flag) continue;
      if (pos1 == V1.size()) {
        tot++;
        for (int x : V1) {
          S[find(x)].erase({p[x], x});
          S[fa[x] = tot].insert({p[x], x});
        }
      } else {
        tot++;
        for (int x : V2) {
          S[find(x)].erase({p[x], x});
          S[fa[x] = tot].insert({p[x], x});
        }
      }
    }
  }
  return 0;
}
