#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& os, pair<A, B> p) {
  return os << '{' << p.first << ", " << p.second << '}';
}
template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << '{';
  for (T i : v) os << i << ", ";
  return os << '}';
}
void solve() {
  int n;
  scanf("%d", &n);
  printf("%d\n", n);
  for (int i = (0); i <= ((n)-1); ++i) printf("%d ", i + 1);
  printf("\n");
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) solve();
}
