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;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const int nax = 1e6 + 5;
int g[nax];
vector<int> inv[nax];
set<int> s[nax];
void uni(int a, int b, vector<int>& v) {
  debug() << " ["
          << "a"
             ": "
          << (a)
          << "] "
             " ["
          << "b"
             ": "
          << (b) << "] ";
  a = g[a];
  b = g[b];
  if (a == b) {
    return;
  }
  if (inv[a].size() > inv[b].size()) {
    swap(a, b);
  }
  v = inv[a];
  for (int x : inv[a]) {
    g[x] = b;
    inv[b].push_back(x);
  }
  inv[a].clear();
}
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  vector<int> value(n + 1);
  vector<int> inv_value(n + 1);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &value[i]);
    inv_value[value[i]] = i;
  }
  vector<pair<int, int>> edges(m + 1);
  for (int i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    edges[i] = {a, b};
  }
  vector<bool> removed(m + 1);
  vector<pair<int, int>> queries(q);
  for (pair<int, int>& p : queries) {
    scanf("%d%d", &p.first, &p.second);
    if (p.first == 2) {
      removed[p.second] = true;
    }
  }
  for (int i = 1; i <= n; ++i) {
    g[i] = i;
    inv[i] = {i};
  }
  for (int i = 1; i <= m; ++i) {
    if (!removed[i]) {
      vector<int> fake;
      uni(edges[i].first, edges[i].second, fake);
    }
  }
  vector<vector<int>> extract(q);
  debug() << "---";
  for (int i = q - 1; i >= 0; --i) {
    if (queries[i].first == 2) {
      int id = queries[i].second;
      int a = edges[id].first;
      int b = edges[id].second;
      uni(a, b, extract[i]);
    }
  }
  for (int a = 1; a <= n; ++a) {
    debug() << " ["
            << "a"
               ": "
            << (a)
            << "] "
               " ["
            << "g[a]"
               ": "
            << (g[a])
            << "] "
               " ["
            << "inv[a]"
               ": "
            << (inv[a]) << "] ";
  }
  for (int a = 1; a <= n; ++a) {
    if (a == g[a]) {
      assert(!inv[a].empty());
      for (int x : inv[a]) {
        s[a].insert(value[x]);
      }
    }
  }
  int nxt = n + 1;
  for (int iq = 0; iq < q; ++iq) {
    if (queries[iq].first == 1) {
      int a = queries[iq].second;
      a = g[a];
      if (!s[a].empty()) {
        auto it = s[a].end();
        --it;
        int val = *it;
        value[inv_value[val]] = 0;
        s[a].erase(it);
        printf("%d\n", val);
      } else {
        puts("0");
      }
    } else {
      debug() << " ["
              << "extract[iq]"
                 ": "
              << (extract[iq]) << "] ";
      int G = nxt++;
      for (int x : extract[iq]) {
        s[g[x]].erase(value[x]);
        g[x] = G;
        if (value[x]) s[G].insert(value[x]);
      }
    }
  }
}
