#include using namespace std; random_device rng_seed; mt19937_64 rng(rng_seed()); void solve() { int n; cin >> n; vector a(n - 1), b(n); for (int i = 0; i < n - 1; i++) { a.at(i) = rng() % 2; } for (int i = 0; i < 10; i++) { cout << "?"; for (int j = 0; j < n - 1; j++) { cout << " " << a.at(j); } cout << endl; for (int j = 0; j < n; j++) { cin >> b.at(j); } for (int j = 0; j < n - 1; j++) { if (b.at(j) == b.at(j + 1)) { a.at(j) = 1 - a.at(j); } } } cout << "!"; for (int i = 0; i < n; i++) { cout << " " << b.at(i); } cout << endl; } int main() { int t; cin >> t; for (int i = 0; i < t; i++) { solve(); } return 0; }