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