import java.util.Scanner;
public class MULTIPLES {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int T=input.nextInt();
while(T>0){
int N=input.nextInt();
int i=5,j=3;
int sum=0;
while(i<=N) {
while(j<=i) {
if(i==j){
j=j+3;
break;
}
else if(i!=j) {
if(j==N) {
break;
}
System.out.println(j+" ");
sum=sum+j;
System.out.println("sum +"+sum);
j=j+3;
}
}
if(i!=N){
System.out.println(i);
sum=sum+i;
System.out.println("sum +" +sum);
i=i+5;
}
}
T--;
}
}
}