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 inf = 1e9 + 7;
vector<pair<int, int> > edges;
vector<pair<int, int> > queries;
vector<bool> mark;
vector<int> groups[300100];
int par[300100];
vector<int> belong[200100];
vector<int> ops[500100];
pair<int, int> opd[500100];
int val[300100];
bool compare(int a, int b) { return val[a] < val[b]; }
void merge(int a, int b, int t) {
  if (par[a] == par[b]) {
    return;
  }
  a = par[a];
  b = par[b];
  if (groups[a].size() < groups[b].size()) {
    swap(a, b);
  }
  for (int c : groups[b]) {
    par[c] = a;
    groups[a].push_back(c);
  }
  if (t != -1) {
    for (int c : groups[b]) {
      belong[c].push_back(t);
    }
  }
  groups[b].clear();
}
void apply(int t) {
  if (ops[t].size()) {
    int a = opd[t].first;
    int b = opd[t].second;
    for (int i : ops[t]) {
      par[i] = b;
    }
    swap(groups[b], ops[t]);
  }
}
int getans(int a) {
  a = par[a];
  auto& t = groups[a];
  while (t.size()) {
    int mx = t.back();
    t.pop_back();
    if (par[mx] == a && val[mx] != 0) {
      int ans = val[mx];
      val[mx] = 0;
      return ans;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    par[i] = i;
    groups[i].push_back(i);
    int a;
    cin >> a;
    val[i] = a;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    edges.push_back({a, b});
  }
  mark = vector<bool>(m, false);
  for (int i = 0; i < q; i++) {
    int a, b;
    cin >> a >> b;
    b--;
    queries.push_back({a, b});
  }
  for (int i = 0; i < q; i++) {
    if (queries[i].first == 2) {
      mark[queries[i].second] = true;
    }
  }
  for (int i = 0; i < m; i++) {
    if (!mark[i]) {
      merge(edges[i].first, edges[i].second, -1);
    }
  }
  for (int i = q - 1; i >= 0; i--) {
    if (queries[i].first == 2) {
      int j = queries[i].second;
      merge(edges[j].first, edges[j].second, i);
    }
  }
  for (int i = 0; i < n; i++) {
    sort(groups[i].begin(), groups[i].end(), compare);
    for (int a : groups[i]) {
      for (int t : belong[a]) {
        ops[t].push_back(a);
      }
    }
  }
  for (int i = 0; i < q; i++) {
    if (queries[i].first == 2) {
      apply(i);
    } else {
      int a = queries[i].second;
      cout << getans(a) << '\n';
    }
  }
}
