#include <bits/stdc++.h>
using namespace std;
void solve(int testNum) {
  int n;
  cin >> n;
  cout << n << "\n";
  for (int i = 1; i <= n; ++i) cout << i << " ";
  cout << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  for (int t = 1; t <= T; ++t) {
    solve(t);
  }
  return 0;
}
