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.*;

/*
polyakoff
*/

public class Main {

    static FastReader in;
    static PrintWriter out;
    static Random rand = new Random();
    static final int oo = (int) 1e9 + 10;
    static final long OO = (long) 2e18 + 20;
    static final int MOD = (int) 1e9 + 7;
    static final int N = 400_004;

    static int n, m, q, timer;
    static int[] p, par, tin, tout, pos;
    static Edge[] edges;
    static Query[] queries;
    static int[][] sons;
    static ArrayList<Integer> order;

    static class Edge {
        int u, v;
        boolean unstable;

        Edge(int u, int v) {
            this.u = u;
            this.v = v;
        }
    }

    static class Query {
        int type, x;
        int leader; // if type = 1

        Query(int type, int x) {
            this.type = type;
            this.x = x;
        }
    }

    static class SegTree {
        int[] t;
        int size;

        void build(int u, int tl, int tr, ArrayList<Integer> al) {
            if (tl == tr) {
                t[u] = al.get(tl);
            } else {
                int tm = (tl + tr) / 2;
                build(u * 2 + 1, tl, tm, al);
                build(u * 2 + 2, tm + 1, tr, al);
                t[u] = Math.max(t[u * 2 + 1], t[u * 2 + 2]);
            }
        }
        int maxOn(int u, int tl, int tr, int l, int r) {
            if (r < tl || tr < l)
                return -oo;
            if (l <= tl && tr <= r)
                return t[u];
            int tm = (tl + tr) / 2;
            return Math.max(maxOn(u * 2 + 1, tl, tm, l, r), maxOn(u * 2 + 2, tm + 1, tr, l, r));
        }
        void setIn(int u, int tl, int tr, int i, int val) {
            if (tl == tr) {
                t[u] = val;
            } else {
                int tm = (tl + tr) / 2;
                if (i <= tm) {
                    setIn(u * 2 + 1, tl, tm, i, val);
                } else {
                    setIn(u * 2 + 2, tm + 1, tr, i, val);
                }
                t[u] = Math.max(t[u * 2 + 1], t[u * 2 + 2]);
            }
        }

        void build(ArrayList<Integer> al) {
            size = al.size();
            t = new int[size * 4];
            build(0, 0, size - 1, al);
        }
        int maxOn(int l, int r) {
            return maxOn(0, 0, size - 1, l, r);
        }
        void setIn(int i, int val) {
            setIn(0, 0, size - 1, i, val);
        }
    }

    static int findSet(int u) {
        if (u == par[u])
            return u;
        return par[u] = findSet(par[u]);
    }

    static void uniteSets(int u, int v) {
        u = findSet(u);
        v = findSet(v);
        if (u != v) {
            int parent = n++;
            sons[parent][0] = u;
            sons[parent][1] = v;
            par[parent] = parent;
            par[u] = parent;
            par[v] = parent;
        }
    }

    static void dfs(int u) {
        order.add(p[u]);
        if (p[u] != 0)
            pos[p[u]] = timer;
        tin[u] = timer++;
        for (int i = 0; i < 2; i++) {
            if (sons[u][i] != -1)
                dfs(sons[u][i]);
        }
        tout[u] = timer;
    }

    static void solve() {
        n = in.nextInt();
        m = in.nextInt();
        q = in.nextInt();

        p = new int[N];
        for (int i = 0; i < n; i++) {
            p[i] = in.nextInt();
        }

        edges = new Edge[m];
        for (int i = 0; i < m; i++) {
            int u = in.nextInt() - 1;
            int v = in.nextInt() - 1;
            edges[i] = new Edge(u, v);
        }

        queries = new Query[q];
        for (int i = 0; i < q; i++) {
            int type = in.nextInt();
            int x = in.nextInt() - 1;
            queries[i] = new Query(type, x);
            if (type == 2)
                edges[x].unstable = true;
        }

        par = new int[N]; Arrays.fill(par, -1);
        sons = new int[N][2];
        for (int i = 0; i < n; i++) {
            par[i] = i;
            sons[i][0] = sons[i][1] = -1;
        }

        for (Edge e : edges) {
            if (!e.unstable)
                uniteSets(e.u, e.v);
        }
        for (int i = q - 1; i >= 0; i--) {
            Query query = queries[i];
            if (query.type == 1) {
                int u = query.x;
                query.leader = findSet(u);
            } else {
                Edge e = edges[query.x];
                uniteSets(e.u, e.v);
            }
        }
        for (int u = 1; u < n; u++) {
            uniteSets(0, u);
        }
        int root = findSet(0);

        tin = new int[N];
        tout = new int[N];
        order = new ArrayList<>();
        pos = new int[N];
        timer = 0;
        dfs(root);

        SegTree st = new SegTree();
        st.build(order);

        for (int i = 0; i < q; i++) {
            Query query = queries[i];
            if (query.type == 1) {
                int u = query.leader;
                int maxP = st.maxOn(tin[u], tout[u] - 1);
                out.println(maxP);
                if (maxP != 0)
                    st.setIn(pos[maxP], 0);
            }
        }


    }


    public static void main(String[] args) {
        in = new FastReader();
        out = new PrintWriter(System.out);
//        fileInputOutput();

        int T = 1;
//        T = in.nextInt();
        while (T-- > 0)
            solve();

        out.flush();
        out.close();
    }

    static void fileInputOutput() {
        try {
            in = new FastReader("input.txt");
            out = new PrintWriter(new FileOutputStream("output.txt"));
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
    }

    static void runInThread() {
        Thread thread = new Thread(null, () -> {
            int T = 1;
//            T = in.nextInt();
            while (T-- > 0)
                solve();
        }, "thread1", 1 << 28);
        thread.start();
        try {
            thread.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader() {
            this(System.in);
        }
        FastReader(String file) throws FileNotFoundException {
            this(new FileInputStream(file));
        }
        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }
        String nextLine() {
            String line;
            try {
                line = br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }
    }
}