using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static void Main() { var t = NN; for (var i = 0; i < t; ++i) Solve(); } static void Solve() { var n = NN; var a = new int[n - 1]; while (true) { WriteLine("? " + string.Join(" ", a)); var q = NList; var flg = true; for (var i = 0; i + 1 < n; ++i) { if (q[i] == q[i + 1]) { a[i] = 1 - a[i]; flg = false; } } if (flg) { WriteLine("! " + string.Join(" ", q)); return; } } } static void Judge() { var p = new int[] { 4, 7, 3, 1, 8, 9, 2, 6, 5 }; WriteLine(p.Length); while (true) { var q = ReadLine().Split(); if (q[0] == "?") { var a = new int[p.Length - 1]; for (var i = 0; i < a.Length; ++i) a[i] = int.Parse(q[i + 1]); var b = new int[p.Length]; b[0] = p[0]; for (var i = 0; i + 1 < b.Length; ++i) { if (a[i] == 0) b[i + 1] = Math.Min(b[i], p[i + 1]); else b[i + 1] = Math.Max(b[i], p[i + 1]); } WriteLine(string.Join(" ", b)); } else { var flg = true; for (var i = 0; i < p.Length; ++i) { if (p[i] != int.Parse(q[i + 1])) { WriteLine("WRONG!!!"); flg = false; } } if (flg) { WriteLine("AC!"); return; } } } } }