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