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