#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, x, i, j, k, temp, m;
  cin >> n;
  cout << n << endl;
  for (i = 0; i < n; ++i) {
    cout << i + 1 << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
