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