#include <bits/stdc++.h>
using namespace std;
void print(int vec[], int n) {
  for (int i = 0; i < (int)(n); ++i) {
    cout << vec[i] << " ";
  }
  cout << "\n";
}
void print(vector<int> vec) {
  for (int i = 0; i < (int)(vec.size()); ++i) {
    cout << vec[i] << " ";
  }
  cout << "\n";
}
void print(vector<pair<int, int>> vec) {
  for (int i = 0; i < (int)(vec.size()); ++i) {
    cout << vec[i].first << " " << vec[i].second << "\n";
  }
  cout << "\n";
}
void print(vector<pair<char, int>> vec) {
  for (int i = 0; i < (int)(vec.size()); ++i) {
    cout << vec[i].first << " " << vec[i].second << "\n";
  }
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int cnt = 1;
    for (int i = 0; i < (int)(n / 2); ++i) {
      cout << cnt << " " << cnt << " ";
      cnt += 2;
    }
    if (n % 2 == 1) cout << cnt;
    cout << "\n";
  }
  return 0;
}
