#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
int main(){
unsigned int t,n,x,z;
bool l;
string b;
scanf("%d",&t);
while(t--){
l=true;
b="";
scanf("%d",&n);
z=n;
while(n--){
if(l==true){
scanf("%s",&x);
b+=x;
if(z%2==0)
if(n!=1)
b+=" ";
if(z%2==1)
if(n!=0)
b+=" ";
l=false;
}
else{
scanf("%d",&x);
cout<<x<<" ";
l=true;
}
}
cout<<b<<endl;
}
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpewogICAgdW5zaWduZWQgaW50IHQsbix4LHo7CiAgICBib29sIGw7CiAgICBzdHJpbmcgYjsKICAgIHNjYW5mKCIlZCIsJnQpOwogICAgd2hpbGUodC0tKXsKICAgICAgICBsPXRydWU7CiAgICAgICAgYj0iIjsKICAgICAgICBzY2FuZigiJWQiLCZuKTsKICAgICAgICB6PW47CiAgICAgICAgd2hpbGUobi0tKXsKICAgICAgICAgICAgaWYobD09dHJ1ZSl7CiAgICAgICAgICAgICAgICBzY2FuZigiJXMiLCZ4KTsKICAgICAgICAgICAgICAgIGIrPXg7CiAgICAgICAgICAgICAgICBpZih6JTI9PTApCiAgICAgICAgICAgICAgICAgICAgaWYobiE9MSkKICAgICAgICAgICAgICAgICAgICAgICAgYis9IiAiOwogICAgICAgICAgICAgICAgaWYoeiUyPT0xKQogICAgICAgICAgICAgICAgICAgIGlmKG4hPTApCiAgICAgICAgICAgICAgICAgICAgICAgIGIrPSIgIjsKICAgICAgICAgICAgICAgIGw9ZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZXsKICAgICAgICAgICAgICAgIHNjYW5mKCIlZCIsJngpOwogICAgICAgICAgICAgICAgY291dDw8eDw8IiAiOwogICAgICAgICAgICAgICAgbD10cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGNvdXQ8PGI8PGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==