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 N = 800005;
const int inf = 1000 * 1000 * 1000;
const int mod = 998244353;
mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
int n, m, Q;
int p[200005];
int vert[200005];
int parent[N];
int sz[N];
set<int> q[N];
int edge[N];
bool root[N];
bool used[N];
set<int> g[200005];
set<int>::iterator itt[200005];
int findher(int v) {
  if (root[v]) return v;
  return parent[v] = findher(parent[v]);
}
void tmerge(int a, int b) {
  a = findher(a);
  b = findher(b);
  if (a == b) {
    edge[a]++;
    return;
  }
  if (sz[a] < sz[b]) swap(a, b);
  root[b] = false;
  parent[b] = a;
  sz[a] += sz[b];
  edge[a] += edge[b] + 1;
  while (!q[b].empty()) {
    q[a].insert(*q[b].begin());
    q[b].erase(q[b].begin());
  }
}
vector<pair<int, int> > e;
int main() {
  scanf("%d%d%d", &n, &m, &Q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    vert[p[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    parent[i] = n + i;
    root[n + i] = true;
    sz[n + i] = 1;
    q[n + i].insert(p[i]);
  }
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    e.push_back(make_pair(a, b));
    tmerge(a, b);
    g[a].insert(b);
    g[b].insert(a);
  }
  for (int i = 1; i <= n; i++) {
    itt[i] = g[i].begin();
  }
  int newId = 2 * n;
  while (Q--) {
    int tp;
    scanf("%d", &tp);
    if (tp == 1) {
      int v;
      scanf("%d", &v);
      v = findher(v);
      if ((int)q[v].size() == 0) {
        printf("0\n");
      } else {
        set<int>::iterator it = q[v].end();
        --it;
        printf("%d\n", *it);
        p[vert[*it]] = 0;
        q[v].erase(it);
      }
    } else {
      int id;
      scanf("%d", &id);
      --id;
      int a = e[id].first, b = e[id].second;
      g[a].erase(b);
      g[b].erase(a);
      itt[a] = g[a].begin();
      itt[b] = g[b].begin();
      int P = findher(a);
      edge[P]--;
      if (edge[P] >= sz[P] - 1) continue;
      vector<int> vertex1, vertex2;
      queue<int> q1, q2;
      vertex1.push_back(a);
      vertex2.push_back(b);
      q1.push(a);
      q2.push(b);
      int e1 = 0, e2 = 0;
      while (true) {
        while (!q1.empty()) {
          int v = q1.front();
          if (itt[v] == g[v].end()) {
            q1.pop();
            continue;
          }
          if (used[*itt[v]] == false) {
            used[*itt[v]] = true;
            q1.push(*itt[v]);
            vertex1.push_back(*itt[v]);
            ++e1;
            ++itt[v];
            break;
          }
          ++itt[v];
          ++e1;
        }
        while (!q2.empty()) {
          int v = q2.front();
          if (itt[v] == g[v].end()) {
            q2.pop();
            continue;
          }
          if (used[*itt[v]] == false) {
            used[*itt[v]] = true;
            q2.push(*itt[v]);
            vertex2.push_back(*itt[v]);
            ++e2;
            ++itt[v];
            break;
          }
          ++itt[v];
          ++e2;
        }
        if ((int)q1.size() == 0 || (int)q2.size() == 0) break;
      }
      if ((int)q1.size() == 0) {
        ++newId;
        edge[newId] = e1 / 2;
        root[newId] = true;
        for (int j = 0; j < (int)vertex1.size(); j++) {
          int v = vertex1[j];
          parent[v] = newId;
          sz[newId]++;
          if (p[v] != 0) {
            q[P].erase(p[v]);
            q[newId].insert(p[v]);
          }
        }
        edge[P] -= edge[newId];
        parent[newId] = newId;
      } else {
        ++newId;
        edge[newId] = e2 / 2;
        root[newId] = true;
        for (int j = 0; j < (int)vertex2.size(); j++) {
          int v = vertex2[j];
          parent[v] = newId;
          sz[newId]++;
          if (p[v] != 0) {
            q[P].erase(p[v]);
            q[newId].insert(p[v]);
          }
        }
        edge[P] -= edge[newId];
        parent[newId] = newId;
      }
      for (int j = 0; j < (int)vertex1.size(); j++) {
        int gag = vertex1[j];
        itt[gag] = g[gag].begin();
        used[gag] = false;
      }
      for (int j = 0; j < (int)vertex2.size(); j++) {
        int gag = vertex2[j];
        itt[gag] = g[gag].begin();
        used[gag] = false;
      }
    }
  }
  return 0;
}
