#include <bits/stdc++.h>
using namespace std;
void fun() {
  long long x, y, n;
  cin >> x >> y >> n;
  long long r = n % x;
  long long q = n / x;
  if (r == y) {
    cout << n << endl;
    return;
  }
  if (y > r) {
    long long ans = q * x;
    ans = ans - (x - y);
    cout << ans << endl;
    return;
  }
  if (r > y) {
    long long ans;
    ans = n - (r - y);
    cout << ans << endl;
  }
}
void solve() {
  long long n;
  cin >> n;
  int th = 0, tw = 0;
  long long m = n;
  long long k = n;
  while (k % 3 == 0) k /= 3;
  while (k % 2 == 0) k /= 2;
  if (k != 1) {
    cout << "-1\n";
    return;
  }
  while (m % 3 == 0) {
    th++;
    m /= 3;
  }
  m = n;
  while (m % 2 == 0) {
    tw++;
    m /= 2;
  }
  if (tw > th) {
    cout << "-1\n";
    return;
  }
  long long ans = th + (th - tw);
  cout << ans << endl;
}
void solveit() {}
void Aprob() {
  long long n;
  cin >> n;
  long long ans = 0;
  long long arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 1; i < n; i++) {
    long long f = min(arr[i], arr[i - 1]);
    long long s = max(arr[i], arr[i - 1]);
    ans += s - f - 1;
  }
  cout << ans << endl;
}
long long sum(long long n) {
  long long val = 0;
  while (n) {
    val += (n % 10);
    n /= 10;
  }
  return val;
}
void Bprob() {
  long long n;
  cin >> n;
  long long c = 0, m = 0;
  while (n--) {
    long long a, b;
    cin >> a >> b;
    long long csum = sum(a);
    long long msum = sum(b);
    if (csum > msum)
      c++;
    else if (msum > csum)
      m++;
    else {
      c++;
      m++;
    }
  }
  if (c > m) {
    cout << "0 " << c << "\n";
  } else if (m > c) {
    cout << "1 " << m << "\n";
  } else {
    cout << "2 " << c << endl;
  }
}
void Cprob() {
  int k;
  cin >> k;
  vector<vector<char>> v(8, vector<char>(8, 'X'));
  int c = 1;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      if (c > k) {
        break;
      }
      v[i][j] = '.';
      c++;
    }
    if (c > k) break;
  }
  v[0][0] = 'O';
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      cout << v[i][j];
    }
    cout << endl;
  }
  cout << endl;
}
void Eprob() {
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < n; j++) cin >> b[j];
  sort(a, a + n);
  sort(b, b + n);
  int mini = min(a[0], b[0]);
  vector<int> na, nb, nc;
  set<int> s;
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      na.push_back(a[i]);
      nb.push_back(b[i]);
      nc.push_back(a[i]);
      nc.push_back(b[i]);
      s.insert(a[i]);
      s.insert(b[i]);
    }
  }
  map<int, int> check;
  for (auto ncval : nc) {
    check[ncval]++;
  }
  for (auto mc : check) {
    if ((mc.second) % 2 != 0) {
      cout << "-1\n";
      return;
    }
  }
  int mina = INT_MAX;
  int minb = INT_MAX;
  map<int, int> mpa, mpb;
  for (auto ai : na) {
    mpa[ai]++;
    mina = min(mina, ai);
  }
  for (auto bi : nb) {
    mpb[bi]++;
    minb = min(minb, bi);
  }
  vector<int> froma;
  vector<int> fromb;
  vector<int> finala, finalb;
  for (auto sval : s) {
    int temp = (mpa[sval] + mpb[sval]) / 2;
    int store;
    if (mpa[sval] > temp) {
      froma.push_back(mpa[sval] - temp);
      store = mpa[sval] - temp;
      for (int i = 1; i <= store; i++) finala.push_back(sval);
    }
    if (mpb[sval] > temp) {
      fromb.push_back(mpb[sval] - temp);
      store = mpb[sval] - temp;
      for (int i = 1; i <= store; i++) finalb.push_back(sval);
    }
  }
  sort(finala.begin(), finala.end());
  sort(finalb.begin(), finalb.end(), greater<int>());
  long long ans = 0;
  for (int i = 0; i < finala.size(); i++) {
    int tempmini = min((2 * mini), min(finala[i], finalb[i]));
    ans += tempmini;
  }
  cout << ans << endl;
}
bool isprime(long long no) {
  if (no == 1) {
    return true;
  }
  for (long long i = 2; i * i <= no; i++) {
    if (no % i == 0) return false;
  }
  return true;
}
void qa() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "1\n";
    return;
  }
  for (int i = 1; i <= n; i++) {
    cout << "1 ";
  }
  cout << endl;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    qa();
  }
  return 0;
}
