#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 10;
const long long int LOG = 50;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e9 + 10;
int t, n;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    cout << n << '\n';
    for (int i = 1; i <= n; i++) cout << i << ' ';
    cout << '\n';
  }
  return 0;
}
