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>
#define sz(x) ((int)(x).size())
using namespace std;
typedef long long ll;
const int n = 2e5 + 5;

int N, M, Q, K;
vector<int> G[n];
int Cmp[2*n], L[2*n], R[2*n];
bool vis[2*n];

struct segment_tree {
  // data (sum and length of a segment)
  struct data {
    int v = -1, i = -1;
  };
  // operation on the data (x -> a * x + b)
  struct operation {
    int a = 1, b = 0;
  };
  // alternatively use typedefs for simpler data and operations
  // combine the data from different segments
  static data combine(data dl, data dr) {
		if(dl.v >= dr.v) return dl;
		return dr;
  }
  // calculate the result of an operation on the data
  static data calculate(operation o, data d) {
    return d;
  }
  // merge an operation onto another operation
  static operation merge(operation ot, operation ob) {
    return ot;
  }
  int n, h;
  vector<data> t;
  vector<operation> o;
  segment_tree(int n = 0) : n(n), h(32 - __builtin_clz(n)), t(2 * n), o(n) {}
  segment_tree(vector<data> & a) : segment_tree(a.size()) {
    for (int i = 0; i < n; i++)
      t[i + n] = a[i];
    for (int x = n - 1; x > 0; x--)
      t[x] = combine(t[x << 1], t[x << 1 | 1]);
  }
  void apply(int x, operation op) {
    t[x] = calculate(op, t[x]);
    if (x < n)
      o[x] = merge(op, o[x]);
  }
  void push(int x) {
    for (int s = h; s > 0; s--) {
      int c = x >> s;
      apply(c << 1, o[c]);
      apply(c << 1 | 1, o[c]);
      o[c] = operation();
    }
  }
  void build(int x) {
    while (x >>= 1)
      t[x] = calculate(o[x], combine(t[x << 1], t[x << 1 | 1]));
  }
  // set the data at the position i
  void setValue(int i, data d) {
    i += n;
    push(i);
    t[i] = d;
    build(i);
  }
  // query the data on the range [l, r[
  data query(int l, int r) {
    l += n; r += n;
    push(l); push(r - 1);
    data dl, dr;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1)
        dl = combine(dl, t[l++]);
      if (r & 1)
        dr = combine(t[--r], dr);
    }
    return combine(dl, dr);
  }
  // apply an operation on the range [l, r[
  void apply(int l, int r, operation op) {
    l += n; r += n;
    push(l); push(r - 1);
    int xl = l, xr = r;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1)
        apply(l++, op);
      if (r & 1)
        apply(--r, op);
    }
    build(xl); build(xr - 1);
  }
};



void dfs(int v, int off = 0){
	vis[v] = true;
	L[v] = off;
	for(int c : G[v]){
		dfs(c, off);
		off = R[c]+1;
	}
	if(sz(G[v]) == 0) R[v] = L[v];
	else R[v] = off-1;
}

int find(int x){
	if(Cmp[x] != x) Cmp[x] = find(Cmp[x]);
	return Cmp[x];
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> N >> M >> Q;
	vector<int> P(N);
	vector<pair<int,int>> Es;
	vector<int> Edel(M, false);
	for(int i = 0; i < N; ++i) cin >> P[i];
	for(int i = 0; i < M; ++i){
		int a, b; cin >> a >> b; a--; b--;
		Es.push_back({a,b});
	}
	vector<pair<int,int>> Qs;
	for(int i = 0; i < Q; ++i){
		int t, x; cin >> t >> x; x--;
		if(t==1){
			Qs.push_back({t, x});
		}else{
			Qs.push_back({t, x});
			Edel[x] = true;
		}
	}
	for(int i = 0; i < M; ++i){
		if(!Edel[i]){
			Qs.push_back({2, i});
			Q++;
		}
	}
	for(int i = 0; i < N; ++i) Cmp[i] = i;
	int orgN = N;
	for(int q = Q-1; q >= 0; --q){
		auto [t, i] = Qs[q];
		if(t==1){
			int c = find(i);
			Qs[q].second = c;
		}else{
			auto [a, b] = Es[i];
			int cA = find(a), cB = find(b);
			if(cA != cB){
				Cmp[cA] = Cmp[cB] = Cmp[N] = N;
				G[N].push_back(cA); G[N].push_back(cB);
				N++;
			}
		}
	}
	int off = 0;
	for(int i = N-1; i >= 0; --i){
		if(!vis[i]){
			dfs(i, off);
			off = R[i];
		}
	}
	segment_tree S(orgN);
	for(int i = 0; i < orgN; ++i){
		assert(L[i] == R[i]);
		S.setValue(L[i], {P[i], L[i]});
	}

	for(int q = 0; q < Q; ++q){
		auto [t, v] = Qs[q];
		if(t==1){
			auto [val, ind] = S.query(L[v], R[v]+1);
			S.setValue(ind, {0, ind});
			cout << val << "\n";
		}
	}
	return 0;
}
