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 Solution extends PrintWriter {
    
    int[] from;
    int[] to;
    
    
    private void solve() {
        n = sc.nextInt();
        int m = sc.nextInt();
        int q = sc.nextInt();
        p = new int[n];
        idx = new int[n+1];
        for(int i = 0; i < n; i++) {
            p[i] = sc.nextInt();
            idx[p[i]] = i;
        }
        from = new int[m];
        to = new int[m];
        for(int i = 0; i < m; i++) {
            from[i] = sc.nextInt()-1;
            to[i] = sc.nextInt()-1;
        }
        int[][] queries = new int[q][];
        
        boolean[] edges_not_to_add = new boolean[m];
        for(int i = 0; i < q; i++) {
            queries[i] = new int[] {sc.nextInt(), sc.nextInt()-1};
            if(queries[i][0] == 2) {
                edges_not_to_add[queries[i][1]] = true;
            } 
        }
        
        parent = new int[2*n];
        for(int i = 0; i < n; i++) make_set(i);
        
        for(int i = 0; i < m; i++) {
            if(!edges_not_to_add[i]) union(from[i], to[i]);
        }
        
        for(int i = q-1; i >= 0; i--) {
            if(queries[i][0] == 2) {
                int e = queries[i][1];
                union(from[e], to[e]);
            } else {
                queries[i][1] = find_set(queries[i][1]);
            }
        }
        adj = new ArrayDeque[n];
        for(int i = 0; i < n; i++) adj[i] = new ArrayDeque<>();
        for(int v = 0; v < n; v++) if(v != parent[v]) adj[parent[v]].add(v);
        tin = new int[n];
        tout = new int[n];
        
        t = new int[n];
        
        for(int u = 0; u < n; u++) {
            if(parent[u] == u) dfs(u);
        }
        
        max = new int[4*n];
        build(0, n-1, 1);
        
        for(int i = 0; i < q; i++) {
            if(queries[i][0] == 1) {
                int l = tin[queries[i][1]];
                int r = tout[queries[i][1]];
                int ans = query(0,n-1,1,l,r);
                println(ans);
                if(ans > 0) set(0,n-1,1,tin[idx[ans]]);
            }
        }
    }
    

    int[] max;
    
    int[] idx;
    int[] t;
    
    void build(int il, int ir, int i) {
        if(il == ir) {
            max[i] = t[il];
        } else {
            int imid = (il+ir)/2;
            build(il, imid, 2*i);
            build(imid+1, ir, 2*i+1);
            max[i] = Math.max(max[2*i], max[2*i+1]);
        }
    }
    
    int query(int il, int ir, int i, int ql, int qr) {
        if(il > qr || ql > ir) return 0;
        
        if(ql <= il && ir <= qr) {
            return max[i];
        }
        
        int imid = (il+ir)/2;
        int max_l = query(il, imid, 2*i, ql, qr);
        int max_r = query(imid+1, ir, 2*i+1, ql, qr);
        return Math.max(max_l, max_r);
    }
    
    void set(int il, int ir, int i, int q) {
        if(il > q || q > ir) return;
        
        if(q == il) {
            max[i] = 0;
            return;
        }
        
        int imid = (il+ir)/2;
        set(il, imid, 2*i, q);
        set(imid+1, ir, 2*i+1, q);
        max[i] = Math.max(max[2*i], max[2*i+1]);
    }

    ArrayDeque<Integer>[] adj;
    int[] tin;
    int[] tout;
    int timer;
    
    int[] p;
    
    void dfs(int u) {
        tin[u] = timer++;
        if(u < p.length) {
            t[tin[u]] = p[u];
        } 
        for(int v : adj[u]) {
            dfs(v);
        }
        tout[u] = timer-1;
    }
    
    int n;    
    int[] parent;
    
    void make_set(int u) {
        parent[u] = u;
    }
    
    int find_set(int u) {
        if(parent[u] == u) return u;
        else return parent[u] = find_set(parent[u]);
    }
    
    void union(int u, int v) {
        if(u == parent[u] && v == parent[v] && u != v) {
            make_set(n);
            parent[u] = n;
            parent[v] = n;
            n++;
            return;
        }
        u = find_set(u);
        v = find_set(v);
        if(u != v) {
            parent[u] = v;
        }
    }
    
//  Solution() throws FileNotFoundException { super(new File("output.txt")); }
//  InputReader sc = new InputReader(new FileInputStream("test_input.txt"));
  Solution() { super(System.out); }
  InputReader sc = new InputReader(System.in);
  static class InputReader {
      InputReader(InputStream in) { this.in = in; } InputStream in;
      
      private byte[] buf = new byte[16384];
      private int    curChar;
      private int    numChars;
      
 
      public int read() {
          if (numChars == -1)
              throw new InputMismatchException();
          if (curChar >= numChars) {
              curChar = 0;
              try {
                  numChars = in.read(buf);
              } catch (IOException e) {
                  throw new InputMismatchException();
              }
              if (numChars <= 0)
                  return -1;
          }
          return buf[curChar++];
      }
 
      public String nextLine() {
          int c = read();
          while (isSpaceChar(c))
              c = read();
          StringBuilder res = new StringBuilder();
          do {
              res.appendCodePoint(c);
              c = read();
          } while (!isEndOfLine(c));
          return res.toString();
      }
 
      public String nextString() {
          int c = read();
          while (isSpaceChar(c))
              c = read();
          StringBuilder res = new StringBuilder();
          do {
              res.appendCodePoint(c);
              c = read();
          } while (!isSpaceChar(c));
          return res.toString();
      }
 
      public long nextLong() {
          int c = read();
          while (isSpaceChar(c))
              c = read();
          int sgn = 1;
          if (c == '-') {
              sgn = -1;
              c = read();
          }
          long res = 0;
          do {
              if (c < '0' || c > '9')
                  throw new InputMismatchException();
              res *= 10;
              res += c - '0';
              c = read();
          } while (!isSpaceChar(c));
          return res * sgn;
      }
 
      public int nextInt() {
          int c = read();
          while (isSpaceChar(c))
              c = read();
          int sgn = 1;
          if (c == '-') {
              sgn = -1;
              c = read();
          }
          int res = 0;
          do {
              if (c < '0' || c > '9')
                  throw new InputMismatchException();
              res *= 10;
              res += c - '0';
              c = read();
          } while (!isSpaceChar(c));
          return res * sgn;
      }
 
      private boolean isSpaceChar(int c) {
          return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
      }
 
      private boolean isEndOfLine(int c) {
          return c == '\n' || c == '\r' || c == -1;
      }
  }
 
    public static void main(String[] $) {
        new Thread(null, new Runnable() {
            public void run() {
                long start = System.nanoTime();
                try {Solution solution = new Solution(); solution.solve(); solution.flush();} 
                catch (Exception e) {e.printStackTrace(); System.exit(1);}
                System.err.println((System.nanoTime()-start)/1E9);
            }
        }, "1", 1 << 27).start();
 
    }
    

}