#include <iostream>
#include <vector>
using namespace std;
int n, k;
long long ans = 0, now = 1;
int a[1000005];
void solution() {
	int n;
	cin >> n;
	int a[2000000];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i += 2) {
		cout << a[i] << " ";
	}
	for (int i = 1; i < n; i += 2) {
		cout << a[i] << " ";
	}
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	while (t--) {
		solution();
	}
}