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