#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=998244353 import sys input=sys.stdin.readline t = int(input()) for _ in range(t): n = int(input()) binn = n.bit_length() que = [[0] * (n - 1) for _ in range(binn)] for i in range(1,n): for j in range(binn): if i >> j & 1: que[j][i-1] = 1 res = [] for i in range(binn): print('?',*que[i],flush=True) tmp = list(map(int,input().split())) res.append(tmp) ans = [res[0][0]] for j in range(1,n): for i in range(binn): if res[i][j] != ans[-1]: ans.append(res[i][j]) break print('!',*ans,flush = True)