#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    int a[1000], n;
    scanf("%d", &n);
    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d ", i);
    printf("\n");
  }
}
