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;
pair<int, int> seg[500005 * 4];
int p[500005];
int dfsValue[500005];
void init(int pos, int l, int r) {
  if (l == r) {
    seg[pos] = {dfsValue[l], l};
    return;
  }
  int mid = (l + r) / 2;
  init(pos * 2, l, mid);
  init(pos * 2 + 1, mid + 1, r);
  seg[pos] = max(seg[pos * 2], seg[pos * 2 + 1]);
}
void update(int pos, int l, int r, int ind) {
  if (l == r) {
    seg[pos] = {0, 0};
    return;
  }
  int mid = (l + r) / 2;
  if (ind <= mid) {
    update(pos * 2, l, mid, ind);
  } else {
    update(pos * 2 + 1, mid + 1, r, ind);
  }
  seg[pos] = max(seg[pos * 2], seg[pos * 2 + 1]);
}
pair<int, int> qq(int pos, int l, int r, int ql, int qr) {
  if (r < ql || qr < l) {
    return {0, 0};
  }
  if (ql <= l && r <= qr) {
    return seg[pos];
  }
  int mid = (l + r) / 2;
  return max(qq(pos * 2, l, mid, ql, qr), qq(pos * 2 + 1, mid + 1, r, ql, qr));
}
int l[500005], r[500005], dfsPos = 1;
vector<int> adj[500005];
void dfs(int node) {
  l[node] = dfsPos;
  dfsValue[dfsPos++] = p[node];
  for (int ch : adj[node]) {
    dfs(ch);
  }
  r[node] = dfsPos - 1;
}
pair<int, int> query[500005];
int a[500005], b[500005];
bool used[500005];
int dsu[500005], root[500005];
int f(int x) {
  if (x == dsu[x]) {
    return x;
  }
  return dsu[x] = f(dsu[x]);
}
bool merge(int x, int y) {
  x = f(x), y = f(y);
  if (x != y) {
    dsu[x] = y;
    return true;
  }
  return false;
}
int subTree[500005];
void mergeTree(int x, int y, int id) {
  int u = root[f(x)], v = root[f(y)];
  if (merge(x, y)) {
    adj[id].push_back(u);
    adj[id].push_back(v);
    merge(id, u);
    root[f(x)] = id;
  }
}
void solve() {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d ", &p[i]);
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d ", &a[i], &b[i]);
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%d %d ", &query[i].first, &query[i].second);
    if (query[i].first == 2) {
      used[query[i].second] = true;
    }
  }
  int numVert = n + m;
  for (int i = numVert; i; --i) {
    dsu[i] = i;
    root[i] = i;
  }
  for (int i = 1; i <= m; ++i) {
    if (!used[i]) {
      int id = i + n;
      int x = a[i], y = b[i];
      mergeTree(x, y, id);
    }
  }
  for (int i = q; i; --i) {
    if (query[i].first == 2) {
      int id = query[i].second + n;
      int x = a[query[i].second], y = b[query[i].second];
      mergeTree(x, y, id);
    } else {
      subTree[i] = root[f(query[i].second)];
    }
  }
  for (int i = numVert; i; --i) {
    if (f(i) == i) {
      dfs(root[i]);
    }
  }
  init(1, 1, numVert);
  for (int i = 1; i <= q; ++i) {
    if (query[i].first == 1) {
      pair<int, int> ret = qq(1, 1, numVert, l[subTree[i]], r[subTree[i]]);
      printf("%d\n", ret.first);
      if (ret.first != 0) {
        update(1, 1, numVert, ret.second);
      }
    }
  }
}
int main() {
  solve();
  return 0;
}
