#include <bits/stdc++.h>
using namespace std;
bool comp(int x, int y) { return x > y; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int tt = 1;
  cin >> tt;
  long long m, n, k;
  string st;
  while (tt--) {
    cin >> n;
    cout << n << endl;
    for (long long i = 1; i < n + 1; i++) cout << i << " ";
    cout << endl;
  }
}
