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>
#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds;
using namespace std;
 
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
 
typedef long long ll;
typedef pair<int,int> pii;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const int maxN = 200005;
const int maxM = 300005;
const int maxQ = 500005;
const int INF = (int)2e9;

int N, M, Q, P[maxN], par[maxN], T[maxN];
pii E[maxM], Qs[maxQ];
bitset<maxM> f;
set<pii> sets[maxQ], elems[maxN];

void init(){
	for(int i=1; i<=N; ++i){
		elems[i].clear();
		elems[i].insert(mp(N-P[i], i));
		par[i] = -1;
	}
}

int find_root(int n){
	if(par[n]==-1) return n;
	return par[n]=find_root(par[n]);
}

bool unionAB(int a, int b, int i){
	a = find_root(a);
	b = find_root(b);
	if(a==b) return false;
	if(elems[a].size()>elems[b].size()) swap(a, b);
	if(i) sets[i] = elems[a];
	for(pii p : elems[a]) elems[b].insert(p);
	elems[a].clear();
	par[a] = b;
	return true;
}

bool unionAB(int a, int b){
	return unionAB(a, b, 0);
}

int main(){
	cin.sync_with_stdio(0);
	cin.tie(0);
	cin >> N >> M >> Q;
	for(int i=1; i<=N; ++i) cin >> P[i];
	for(int i=1; i<=M; ++i){
		int a, b; cin >> a >> b;
		E[i] = mp(a, b);
	}
	for(int i=1; i<=Q; ++i){
		int op, x;
		cin >> op >> x;
		Qs[i] = mp(op, x);
		if(op==2) f[x] = 1;
	}
	init();
	for(int i=1; i<=M; ++i){
		if(f[i]) continue;
		unionAB(E[i].first, E[i].second);
	}
	int x;
	for(int i=Q; i>0; --i){
		if(Qs[i].first==1) continue;
		x = Qs[i].second;
		unionAB(E[x].first, E[x].second, i);
	}
	init();
	vector<set<pii>> vec;
	for(int i=1; i<=M; ++i) unionAB(E[i].first, E[i].second);
	for(int i=1; i<=N; ++i){
		if(par[i]==-1){
			T[i] = (int)vec.size();
			vec.pb(elems[i]);
		}
	}
	for(int i=1; i<=N; ++i) T[i] = T[find_root(i)];
	for(int i=1; i<=Q; ++i){
		int op = Qs[i].first;
		x = Qs[i].second;
		if(op==1){
			if(vec[T[x]].empty()) printf("0\n");
			else{
				auto y = vec[T[x]].begin();
				pii p = mp(N, (*y).second);
				printf("%d\n", N-(*y).first);
				vec[T[x]].erase(y);
				vec[T[x]].insert(p);
			}
		}else{
			vec.pb(sets[i]);
			for(pii p : sets[i]){
				vec[T[p.second]].erase(p);
				T[p.second] = (int)vec.size()-1;
			}
		}
	}
	return 0;
}