// Arup Guha
// 5/1/2019
// Solution to 2019 Code Jam Round 1B Problem: Draupnir

import java.util.*;

public class Solution {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		int w = stdin.nextInt();

		// Process all cases.
		for (int loop=1; loop<=nC; loop++) {
			
			// 220/6 = 36, 220/5 = 44, 220/4 = 55
			System.out.println(220);
			System.out.flush();
			long tmp = stdin.nextLong();
			long[] ans = new long[7];
			
			// This is bit shifted 55 bits, so answer for 4 is revealed there.
			ans[4] = (tmp >> 55);
			
			// This is bit shifted 44, to clip out the bigger portion of the answer(4) & with 7 1 bits.
			ans[5] = ((tmp >> 44) & 127);
			
			// Same deal here.
			ans[6] = ((tmp >> 36) & 127);
			
			// 56/1 = 56, 56/2 = 28, 56/3 = 18, 56/4 = 14, 56/5 = 10
			// Issue here is that answer for 4, 5, 6 can interfere, but we
			// can just subtract these out...
			System.out.println(56);
			System.out.flush();
			tmp = stdin.nextLong();
			
			// Subtract out the effect of 4, 5 and 6 rings.
			tmp = tmp - (ans[4] << 14) - (ans[5] << 11) - (ans[6] << 9);
			
			// Now we can isolate 1, 2 and 3.
			ans[1] = (tmp >> 56);
			ans[2] = ((tmp >> 28) & 127);
			ans[3] = ((tmp >> 18) & 127);
			
			// Ta da!
			for (int i=1; i<=5; i++)
				System.out.print(ans[i]+" ");
			System.out.println(ans[6]);
			
			// They give us an answer after we give them one, so you have to read it.
			int myresponse = stdin.nextInt();
			if (myresponse == -1) break;
		}
	}
}