#include <bits/stdc++.h>
using namespace std;
const long long int N = 3e5 + 5;
void solve() {
  int n;
  cin >> n;
  cout << n << "\n";
  for (int i = 1; i <= n; i++) {
    cout << i << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) solve();
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
