#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k = 1;
    cin >> n;
    if (n % 2 == 0) {
      for (int i = 0; i < (n / 2); i++) {
        cout << k << " " << k << " ";
        k = k + 2;
      }
      cout << "\n";
    } else {
      for (int i = 0; i < (n / 2); i++) {
        cout << k << " " << k << " ";
        k = k + 2;
      }
      cout << k << "\n";
      ;
    }
    k = 1;
  }
}
