#include <bits/stdc++.h>
using namespace std;
long long arr[500007], brr[500007], crr[500007];
long long ar[1000][1000], br[1000][1000], cr[1000][1000];
char att[1000], mm;
string g, h, v;
int main() {
  long long a, b, c, d, e, f, i, j, k, l, m, n, r, t, w, x, y, z, ans, sum;
  cin >> t;
  while (t--) {
    d = 0, e = 0, f = 0, l = 0, n = 0, ans = 0, sum = 0;
    vector<long long> v1;
    cin >> a;
    cout << a << endl;
    for (i = 1; i <= a; i++) cout << i << " ";
    cout << endl;
  }
  return 0;
}
