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