#include <stdio.h>
main()
{
int a,i,t;
scanf("%d",&i);
while(i--)
{
scanf("%d",&a);
{for(t=0;t<=a;t++)
if(t%2!=0)
printf("%d ",t);}
printf("
");
{
for(t=1;t<=a;t++)
if(t%2==0)
printf("%d ",t);
}
}
}