import java.util.*; public class Main{ public static void main(String arg[]){ Scanner sc = new Scanner(System.in); int T = sc.nextInt(); int R = sc.nextInt(); for(int i = 0; i < T; i++){ int N = sc.nextInt(); while(N > 0){ int v = sc.nextInt(); } System.out.println("0"); System.out.flush(); } } }