#include <bits/stdc++.h>
using namespace std;
const long double EPS = 10e-9;
const int INF = 1e9 + 5;
const long long INFLL = (long long)INF * (long long)INF;
const long long MOD = 1e9 + 7;
const long double PI = 3.14159265358979323846;
struct HASH {
  size_t operator()(const pair<int, int> &x) const {
    return hash<long long>()(((long long)x.first) ^
                             (((long long)x.second) << 32));
  }
};
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '[';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "]";
}
void _print() { cerr << "\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
struct Offset {
  set<long long> s;
  long long delta;
  long long getMinimum() { return (*s.begin()) + delta; }
  long long getMaximum() { return (*s.rbegin()) + delta; }
  void increase(long long x) { delta += x; }
  void add(long long x) { s.insert(x - delta); }
  void remove(long long x) { s.erase(x - delta); }
  bool contains(long long x) { return s.count(x - delta) != 0; }
};
long long rand(long long a, long long b) { return a + rand() % (b - a + 1); }
void solve() {
  int n;
  cin >> n;
  cout << n << "\n";
  for (int i = 0; i < n; i++) {
    cout << i + 1 << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
