import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main92 { public static void main(String[] args) { Main92 p = new Main92(); } public Main92() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt(); d = new int[k]; ArrayList> city = new ArrayList>(); for(int i=0;i()); } for(int i=0;i> city) { isOk = new boolean[city.size()]; memo = new int[n][k]; for(int i=0;i0 ? ' ' : '\n')); } } } private void dfs(int curc, int curk, ArrayList> city) { // System.out.println(curc+" "+curk); if(curk==d.length){ isOk[curc] = true; return; } if(memo[curc][curk]==1) return; for(int i=0;i