T = int(input()) for _ in range(T): N = int(input()) P = [0] * N for q in range(10): print("?", end = " ") A = [0] * (N - 1) for i in range(N - 1): if i % 2 == q % 2: A[i] = 1 if i + 1 != N - 1: print(A[i], end = " ") else: print(A[i], flush = True) B = list(map(int, input().split())) P[0] = B[0] for i in range(N - 1): if B[i] != B[i + 1]: P[i + 1] = B[i + 1] print("!", end = " ") for i in range(N): if i + 1 != N: print(P[i], end = " ") else: print(P[i], flush = True)