#include <bits/stdc++.h>
using namespace std;
int t;
int n, m;
void init() { cin >> n; }
void obl() {
  cout << n << "\n";
  for (int i = 1; i <= n; i++) cout << i << " ";
  cout << "\n";
}
int main() {
  std::ios_base::sync_with_stdio(0);
  cin >> t;
  while (t-- > 0) {
    init();
    obl();
  }
}
