#include <bits/stdc++.h>
using namespace std;
template <typename TYPE>
void readint(TYPE& x) {
  x = 0;
  int f = 1;
  char c;
  for (c = getchar(); !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  x *= f;
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
template <typename... T>
void read(T&... args) {
  ((cin >> args), ...);
}
template <typename... T>
void write(T... args) {
  ((cout << args << ' '), ...);
  cout << '\n';
}
const long long MOD = 1e9 + 7, MAX = 1005;
const char nl = '\n';
const long long INF = 2e9;
int n;
long long x, y;
void solve() {
  read(n);
  write(n);
  for (int i = 1; i < n + 1; i++) cout << i << ' ';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int __;
  cin >> __;
  while (__--) {
    solve();
    cout << nl;
  }
  return 0;
}
