//NIL_KHADKE
#include<bits/stdc++.h>
using namespace std;

#define ll long long

bool compare(int a1, int a2)
{
	if (a1 % 2 == 0 && a2 % 2 == 1)
	{
		return true;
	}

	return false;
}


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int test;
	cin >> test;
	while (test--) {
		int n;
		cin >> n;
		int array[n + 15];

		for (int i = 0; i < n; i++)
		{
			cin >> array[i];
		}

		sort(array, array + n, compare);

		for (int i = 0; i < n; i++)
		{
			cout << array[i] << " ";
		}

		cout << "\n";
	}

	return 0;
}