#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    int sum = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 1; j <= 100; j++) {
        if ((sum + j) % n == 0) {
          arr[i] = j;
        }
      }
      sum += arr[i];
    }
    for (int i = 0; i < n; i++) {
      cout << arr[i] << " ";
    }
  }
}
