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

import java.io.*;
import java.util.*;
public class Main{
	static int[] p, rank, treeNode,adj[];
	static boolean[]root;
	static int N;
	static int lastNode=0;
	static void preProcessDSU(int n) {
		N=n;
		p = new int[N];
		rank = new int[N];
		treeNode = new int[N];
		root=new boolean[N<<1];
		adj=new int[N<<1][2];
		
		for (int i = 0; i < N; i++) { 
			p[i] = i; treeNode[i] = lastNode++; root[i]=true;
			adj[i<<1][0]=adj[i<<1][1]=adj[i<<1|1][0]=adj[i<<1|1][1]=-1;
		}
	}
	public static int findSet(int i) { return p[i] == i ? i : (p[i] = findSet(p[i])); }
	
	public static boolean isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	
	public static void unionSet(int i, int j) 
	{ 
		if (isSameSet(i, j)) 
			return;
		int x = findSet(i), y = findSet(j);
		
		int u=treeNode[x],v=treeNode[y];
		root[u]=false;root[v]=false;
		int newRoot=lastNode++;
		root[newRoot]=true;
		adj[newRoot][0]=u;adj[newRoot][1]=v;
		
		if(rank[x] > rank[y]) { p[y] = x; treeNode[x]=newRoot;}
		else
		{	p[x] = y; treeNode[y]=newRoot;
			if(rank[x] == rank[y]) rank[y]++; 
		} 
		
	}
	static int time,tin[],tout[];
	static void dfs(int i) {
		tin[i]=++time;
		for(int j:adj[i]) {
			if(j==-1)continue;
			dfs(j);
		}
		tout[i]=time;
	}
	static int[]segTree,index;
	static void updatePoint(int idx) {
		updatePoint(1, 1, time, idx);
	}
	static void updatePoint(int node,int l,int r,int idx) {
		if(l==r) {
			segTree[node]=0;
			return;
		}
		int mid=(l+r)>>1;
		if(idx<=mid) {
			updatePoint(node<<1, l, mid, idx);
		}
		else {
			updatePoint(node<<1|1, mid+1, r, idx);
		}
		if(segTree[node<<1|1]>segTree[node<<1]) {
			segTree[node]=segTree[node<<1|1];
			index[node]=index[node<<1|1];
		}
		else {
			segTree[node]=segTree[node<<1];
			index[node]=index[node<<1];
		}
	}
	static int[] query(int l,int r) {
		return query(1, 1, time,l,r);
	}
	static int[] query(int node,int curL,int curR,int l,int r) {
		if(curR<l || curL>r)return new int[] {-1,-1};
		if(curL>=l && curR<=r) {
			return new int[] {segTree[node],index[node]};
		}
		int mid=(curL+curR)>>1;
		int[]q1=query(node<<1, curL, mid, l, r),q2=query(node<<1|1, mid+1, curR, l, r);
		if(q1[0]>q2[0]) {
			return q1;
		}
		return q2;
	}
	static void insert(int idx,int val) {
		insert(1, 1, time, idx,val);
	}
	static void insert(int node,int l,int r,int idx,int val) {
		if(l==r) {
			segTree[node]=val;
			index[node]=idx;
			return;
		}
		int mid=(l+r)>>1;
		if(idx<=mid) {
			insert(node<<1, l, mid, idx,val);
		}
		else {
			insert(node<<1|1, mid+1, r, idx,val);
		}
		if(segTree[node<<1|1]>segTree[node<<1]) {
			segTree[node]=segTree[node<<1|1];
			index[node]=index[node<<1|1];
		}
		else {
			segTree[node]=segTree[node<<1];
			index[node]=index[node<<1];
		}
	}
	static void main() throws Exception{
		int n=sc.nextInt(),m=sc.nextInt(),q=sc.nextInt();
		int[]vals=sc.intArr(n);
		int[][]edges=new int[m][];
		for(int i=0;i<m;i++) {
			edges[i]=new int[] {sc.nextInt()-1,sc.nextInt()-1};
		}
		int[][]qs=new int[q][];
		boolean[]edgeRemoved=new boolean[m];
		for(int i=0;i<q;i++) {
			qs[i]=new int[] {sc.nextInt(),sc.nextInt()-1};
			if(qs[i][0]==2) {
				edgeRemoved[qs[i][1]]=true;
			}
		}
		preProcessDSU(n);
		for(int i=0;i<m;i++) {
			if(!edgeRemoved[i]) {
				unionSet(edges[i][0], edges[i][1]);
			}
		}
		int[]subtreeRoot=new int[q];
		for(int i=q-1;i>=0;i--) {
			if(qs[i][0]==1) {
				subtreeRoot[i]=treeNode[findSet(qs[i][1])];
			}
			else {
				int edge=qs[i][1];
				unionSet(edges[edge][0], edges[edge][1]);
			}
		}
		tin=new int[n<<1];
		tout=new int[n<<1];
		for(int i=0;i<lastNode;i++) {
			if(root[i]) {
				dfs(i);
			}
		}
		segTree=new int[time<<2];
		Arrays.fill(segTree, -1);
		index=new int[time<<2];
		for(int i=0;i<n;i++) {
			insert(tin[i], vals[i]);
		}
		for(int i=0;i<q;i++) {
			if(qs[i][0]==1) {
				int curRoot=subtreeRoot[i];
				int left=tin[curRoot],right=tout[curRoot];
				int[]curQ=query(left, right);
				pw.println(curQ[0]);
				if(curQ[1]>0)
					updatePoint(curQ[1]);
			}
		}
	}
	public static void main(String[] args) throws Exception{
		sc=new MScanner(System.in);
		pw = new PrintWriter(System.out);
		int tc=1;
//		tc=sc.nextInt();
		while(tc-->0)
			main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}