#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, a, b, c, g, m, mi, c1 = 0, c2 = 0, x, y, r, w;
  cin >> n;
  cout << n << "\n";
  for (int i = 1; i <= n; i++) cout << i << " ";
  cout << '\n';
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
