// Arup Guha
// 4/30/2019
// Written to illustrate straight-forward solution to small case
// 2019 Code Jam Round 1B Problem: Draupnir

import java.util.*;

public class Solution_small {

	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++) {

			// "Interactive part" - pre get answers for days 1 to 6
			long[] res = new long[w+1];
			for (int i=1; i<=w; i++) {
				System.out.println(i);
				
				// Need a flush after each query we send the judge.
				System.out.flush();
				res[i] = stdin.nextLong();
			}
			
			// Solve our equations and output.
			int[] ans = solve(res);
			for (int i=0; i<5; i++)
				System.out.print(ans[i]+" ");
			System.out.println(ans[5]);
			
			// They give us an answer after we give them one, so you have to read it.
			int myresponse = stdin.nextInt();
			if (myresponse == -1) break;
		}

	}
	
	public static int[] solve(long[] res) {
		
		if (res.length == 2) return new int[6];
		
		// I will just try each possible value of 1-rings...
		for (int i=0; i<=100; i++) {
			int[] ans = tryval(res, i);
			if (ans != null)
				return ans;
		}
		
		return new int[6];
	}
	
	public static int[] tryval(long[] res, int x) {
		
		// These are the equations we solved for each day...
		int[] ans = new int[6];
		ans[0] = x;
		ans[1] = (int)(res[2]-res[1]-2*x);
		ans[2] = (int)(res[3]-res[2]-4*x);
		ans[3] = (int)(res[4]-res[3]-8*x-2*ans[1]);
		ans[4] = (int)(res[5]-res[4]-16*x);
		ans[5] = (int)(res[6]-res[5]-32*x-4*ans[1]-2*ans[2]);
			
		// This is the inferred sum for day 0.
		long sum = 0;
		for (int i=0; i<6; i++) {
			sum += ans[i];
		}

		// The difference between day 0 and day 1 must be x (# of 1 rings)
		if (res[1]-sum != x)
			return null;
			
		return ans;
	}
}
