#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
set<int> s;
vector<long long int> plist;
bool prime[100001];
void SieveOfEratosthenes(int n) {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) plist.push_back(p);
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int _mergeSort(int arr[], int temp[], int left, int right);
int merge(int arr[], int temp[], int left, int mid, int right);
int mergeSort(int arr[], int array_size) {
  int temp[array_size];
  return _mergeSort(arr, temp, 0, array_size - 1);
}
int _mergeSort(int arr[], int temp[], int left, int right) {
  int mid, inv_count = 0;
  if (right > left) {
    mid = (right + left) / 2;
    inv_count += _mergeSort(arr, temp, left, mid);
    inv_count += _mergeSort(arr, temp, mid + 1, right);
    inv_count += merge(arr, temp, left, mid + 1, right);
  }
  return inv_count;
}
int merge(int arr[], int temp[], int left, int mid, int right) {
  int i, j, k;
  int inv_count = 0;
  i = left;
  j = mid;
  k = left;
  while ((i <= mid - 1) && (j <= right)) {
    if (arr[i] <= arr[j]) {
      temp[k++] = arr[i++];
    } else {
      temp[k++] = arr[j++];
      inv_count = inv_count + (mid - i);
    }
  }
  while (i <= mid - 1) temp[k++] = arr[i++];
  while (j <= right) temp[k++] = arr[j++];
  for (i = left; i <= right; i++) arr[i] = temp[i];
  return inv_count;
}
long long int binomialCoeff(long long int n, long long int k) {
  long long int res = 1;
  if (k > n - k) k = n - k;
  for (long long int i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int MAXN = 8e5;
pair<int, int> t[800000];
pair<int, int> combine(pair<int, int> a, pair<int, int> b) {
  if (a.first < b.first) return a;
  if (b.first < a.first) return b;
  return make_pair(a.first, ((a.second > b.second) ? b.second : a.second));
}
void build(int a[], int v, int tl, int tr) {
  if (tl == tr) {
    t[v] = make_pair(a[tl], tl);
  } else {
    int tm = (tl + tr) / 2;
    build(a, v * 2, tl, tm);
    build(a, v * 2 + 1, tm + 1, tr);
    t[v] = combine(t[v * 2], t[v * 2 + 1]);
  }
}
long long int modInverse(long long int a, long long int m) {
  long long int g = gcd(a, m);
  if (g != 1)
    cout << "Inverse doesn't exist";
  else {
    return power(a, m - 2, m);
  }
}
vector<long long int> v1(2000);
void modFact(int n, int p) {
  if (n >= p) return;
  long long int result = 1;
  v1[0] = 1;
  for (int i = 1; i <= n; i++) {
    result = (result * i) % p;
    v1[i] = result;
  }
  return;
}
long long int nCrModPFermat(long long int n, int r, int p) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return (v1[n] * modInverse(v1[r], p) % p * modInverse(v1[n - r], p) % p) % p;
}
void solve() {
  long long int l, x, r, g, n, y, m, x1, y1,
      ans1 = 1e9 + 7, ans13 = 0, ans2 = 0, ans3 = 0, ans4 = 1, ans5, sum = 0,
      flag1 = -1, flag2 = -1;
  int k;
  cin >> n;
  cout << n << "\n";
  for (long long int i = 0; i < n; i++) cout << i + 1 << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
