#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> t;
  for (int j = 0; j < t; j++) {
    cin >> n;
    cout << n << " ";
    for (int i = 1; i <= n; i++) {
      cout << i << " ";
    }
  }
}
