#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    cout << m << endl;
    for (int i = 1; i <= m; i++) {
      cout << i << " ";
    }
  }
  return 0;
}
