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();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) {
            p[i] = sc.nextInt()-1;
        }
        from = new int[m];
        to = new int[m];
        for(int i = 0; i < m; i++) {
            from[i] = p[sc.nextInt()-1];
            to[i] = p[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, 0};
            if(queries[i][0] == 2) {
                edges_not_to_add[queries[i][1]] = true;
            } else {
                queries[i][1] = p[queries[i][1]];
            }
        }
        parent = new int[n];
        list = new ArrayDeque[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_sets(from[i], to[i], false);
        }
        

        changes = new int[m];
        SP = 0;
        
        for(int i = q-1; i >= 0; i--) {
            if(queries[i][0] == 2) {
                int e = queries[i][1];
                boolean changed = union_sets(from[e], to[e], true);
                if(changed) queries[i][2] = 1;
            }
        }
        
        sort();
        
        done = new boolean[n];
        
        for(int i = 0; i < q; i++) {
            if(queries[i][0] == 2) {
                if(queries[i][2] == 1)
                    undo(changes[--SP]);
            } else {
                int set = find_set(queries[i][1]);
                
                boolean found = false;
                while(!list[set].isEmpty()) {
                    int last = list[set].removeLast();
                    if(parent[last] == set && !done[last]) {
                        done[last] = true;
                        println(last+1);
                        found = true;
                        break;
                    }
                }
                if(!found) println(0);
            }
        }
        
    }
    
    
    void sort(){
        ArrayDeque<Integer>[] list_idx = new ArrayDeque[n];
        for(int i = 0; i < n; i++) list_idx[i] = new ArrayDeque<>();
        for(int i = 0; i < n; i++) {
            for(int x : list[i]) list_idx[x].add(i);            
        }
        for(int i = 0; i < n; i++) list[i].clear();
        for(int i = 0; i < n; i++) {
            while(!list_idx[i].isEmpty()) {
                list[list_idx[i].remove()].add(i);
            }
        }
    }
    
    int n;    
    
    ArrayDeque<Integer>[] list;
    int[] parent;
    int[] changes;
    int SP;
    boolean[] done;
    
    void make_set(int v) {
        parent[v] = v;
        list[v] = new ArrayDeque<>();
        list[v].add(v);
    }
    
    
    int find_set(int v) {
        return parent[v];
    }
    
    boolean union_sets(int a, int b, boolean save) {
        a = find_set(a);
        b = find_set(b);
        if (a != b) {
            if (list[a].size() < list[b].size()) {
                int temp = a;
                a = b;
                b = temp;
            }
            if(save) {
                changes[SP++] = b;
            }
            for(int x : list[b]) {
                list[a].add(x);
                parent[x] = a;
            }
        } else return false;
        return true;
    }
    
    void undo(int change) {
        for(int x : list[change]) {
            parent[x] = change;
        }
    }
    
    
//  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();
 
    }
    

}