import java.io.*; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static class Edge{ int from; int to; public Edge(int from,int to){ this.from=from; this.to=to; } } public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String[] values=br.readLine().split(" "); int n=Integer.parseInt(values[0]); int m=Integer.parseInt(values[1]); int k=Integer.parseInt(values[2]); ArrayList array; boolean[][] pos=new boolean[k][n]; int[] place=new int[n]; HashMap> map=new HashMap>(); for(int i=0;i(); else array=map.get(c); array.add(new Edge(a,b)); array.add(new Edge(b,a)); map.put(c,array); } StringTokenizer st=new StringTokenizer(br.readLine()); for(int i=0;i