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.util.*;
import java.io.*;

public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = (int) 1e9 + 9;
	static long inf = (long) 1e14;
	static int n, m, q, size;
	static ArrayList<Integer>[] ad;
	static int[][] memo;
	static boolean f;
	static boolean vis[];
	static int[] px, Q[];
	static HashMap<Integer, Integer> hm;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		n = sc.nextInt();
		m = sc.nextInt();
		q = sc.nextInt();
		px = sc.nextArrInt(n);
		ad = new ArrayList[n];
		for (int i = 0; i < n; i++)
			ad[i] = new ArrayList<>();
		int[] x = new int[m];
		int[] y = new int[m];
		boolean[] off = new boolean[m];
		for (int i = 0; i < m; i++) {
			x[i] = sc.nextInt() - 1;
			y[i] = sc.nextInt() - 1;
			ad[x[i]].add(y[i]);
			ad[y[i]].add(x[i]);
		}
		Q = new int[q][2];
		for (int i = 0; i < q; i++) {
			Q[i][0] = sc.nextInt();
			Q[i][1] = sc.nextInt() - 1;
			if (Q[i][0] == 2)
				off[Q[i][1]] = true;
		}
		unionfind uf = new unionfind(n);
		for (int i = 0; i < m; i++)
			if (!off[i])
				uf.combine(y[i], x[i]);
		HashSet<Integer>[] here = new HashSet[q];
		for (int i = q - 1; i >= 0; i--) {
			if (Q[i][0] == 2) {
				int a = x[Q[i][1]];
				int b = y[Q[i][1]];
				if (!uf.combine(a, b)) {
					here[i] = new HashSet<>();
					if (uf.Pl[a].size() > uf.Pl[b].size()) {
						for (int g : uf.Pl[b])
							here[i].add(g);
					} else {
						for (int g : uf.Pl[a])
							here[i].add(g);
					}
				}
			}
		}
		vis = new boolean[n];
		cc = new TreeSet[n];
		where = new int[n];
		for (int i = 0; i < n; i++)
			cc[i] = new TreeSet<>((o, oo) -> px[o] - px[oo]);
		comp = 0;
		for (int i = 0; i < n; i++) {
			if (!vis[i]) {
				dfs(i);
				comp++;
			}
		}
		int ll = 0;
		for (int i = 0; i < q; i++) {
			if (Q[i][0] == 1) {
				int node = Q[i][1];
				int co = where[node];
				if (ll == 32) {
					if (cc[co].isEmpty())
						System.out.println(0);
					else
						System.out.println(ll);
					System.out.println(node);
					System.out.println(co);
					// System.out.println(cc[co]);
					for (int h : cc[co])
						System.out.print(px[h] + " ");
					System.out.println();
					for (int j = 0; j < n; j++)
						if (px[j] == 31) {
							ll = j;
							break;
						}
					System.out.println(ll);
					System.out.println(where[ll]);
					// System.out.println(cc[where[ll]]);
					for (int h : cc[where[ll]])
						System.out.print(px[h] + " ");
					return;
				}
				if (cc[co].isEmpty())
					System.out.println(0);
				else {
					ll = px[cc[co].pollLast()];
					System.out.println(ll);
				}
			} else {
				if (here[i] != null) {
					int a = x[Q[i][1]];
					comp++;
					int co = where[a];
					for (int h : here[i]) {
						if (cc[co].contains(h)) {
							cc[comp].add(h);
							cc[co].remove(h);
						}
						where[h] = comp;
					}
				}
			}
		}
		out.close();
	}

	static int comp, where[];
	static TreeSet<Integer>[] cc;

	static void dfs(int u) {
		vis[u] = true;
		cc[comp].add(u);
		where[u] = comp;
		for (int v : ad[u])
			if (!vis[v])
				dfs(v);
	}

	static class unionfind {
		int[] p;
		int[] size;
		HashSet<Integer>[] Pl;
		int num;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];
			Pl = new HashSet[n];
			for (int i = 0; i < n; i++) {
				p[i] = i;
				Pl[i] = new HashSet<>();
				Pl[i].add(i);
			}
			Arrays.fill(size, 1);
			num = n;
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			p[v] = findSet(p[v]);
			return p[v];
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		boolean combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			num--;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];
				for (int o : Pl[b]) {
					Pl[a].add(o);
					p[o] = a;
				}
			} else {
				p[a] = b;
				size[b] += size[a];
				for (int o : Pl[a]) {
					Pl[b].add(o);
					p[o] = b;
				}
			}
			return false;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(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 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 int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}