#include <bits/stdc++.h>
using namespace std;
const int N = 100002;
int T = 1, n;
inline void go(int t) {
  scanf("%d", &n);
  printf("%d\n", n);
  for (int i = 1; i <= n; ++i) printf("%d ", i);
  putchar('\n');
}
int main() {
  scanf("%d", &T);
  for (int t = 1; t <= T; ++t) {
    go(t);
  }
  return 0;
}
