#include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> a(n);
// Create a palindromic sequence with a repeating pattern
for (int i = 0; i < n; i++) {
a[i] = (i % 2) + 1; // Alternating between 1 and 2 ensures many palindromic subsequences
}
for (int i = 0; i < n; i++) {
cout << a[i] << " ";
}
cout << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIHNvbHZlKCkgewogICAgaW50IG47CiAgICBjaW4gPj4gbjsKICAgIAogICAgdmVjdG9yPGludD4gYShuKTsKICAgIAogICAgLy8gQ3JlYXRlIGEgcGFsaW5kcm9taWMgc2VxdWVuY2Ugd2l0aCBhIHJlcGVhdGluZyBwYXR0ZXJuCiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgIGFbaV0gPSAoaSAlIDIpICsgMTsgLy8gQWx0ZXJuYXRpbmcgYmV0d2VlbiAxIGFuZCAyIGVuc3VyZXMgbWFueSBwYWxpbmRyb21pYyBzdWJzZXF1ZW5jZXMKICAgIH0KICAgIAogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICBjb3V0IDw8IGFbaV0gPDwgIiAiOwogICAgfQogICAgY291dCA8PCBlbmRsOwp9CgppbnQgbWFpbigpIHsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwogICAgY2luLnRpZShOVUxMKTsKICAgIAogICAgaW50IHQ7CiAgICBjaW4gPj4gdDsKICAgIHdoaWxlICh0LS0pIHsKICAgICAgICBzb2x2ZSgpOwogICAgfQogICAgCiAgICByZXR1cm4gMDsKfQo=