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