Problem: Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters.

It's the end of the school year and Sayaka wants to take a picture of all other members of the student council. Being the hard-working and perfectionist girl as she is, she wants to arrange all the members in a line such that the amount of photogenic consecutive pairs of members is as large as possible.

A pair of two consecutive members u and v on a line is considered photogenic if their average height is an integer, i.e. (a_u + a_v)/(2) is an integer.

Help Sayaka arrange the other members to maximize the number of photogenic consecutive pairs.

Input

The first line contains a single integer t (1≤ t≤ 500) — the number of test cases.

The first line of each test case contains a single integer n (2 ≤ n ≤ 2000) — the number of other council members.

The second line of each test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 2 ⋅ 10^5) — the heights of each of the other members in millimeters.

It is guaranteed that the sum of n over all test cases does not exceed 2000.

Output

For each test case, output on one line n integers representing the heights of the other members in the order, which gives the largest number of photogenic consecutive pairs. If there are multiple such orders, output any of them.

Example

Input


4
3
1 1 2
3
1 1 1
8
10 9 13 15 3 16 9 13
2
18 9


Output


1 1 2 
1 1 1 
13 9 13 15 3 9 16 10 
9 18 

Note

In the first test case, there is one photogenic pair: (1, 1) is photogenic, as (1+1)/(2)=1 is integer, while (1, 2) isn't, as (1+2)/(2)=1.5 isn't integer.

In the second test case, both pairs are photogenic.

Solution (in CPP):

Solution:

 #include<algorithm>
 #include<bitset>
 #include<deque>
 #include<iostream>
 #include<iterator>
 #include<map>
 #include<climits>
 #include<queue>
 #include<set>
 #include<stack>
 #include<numeric>
 #include<string>
 #include<vector>
 #include<cstring>
 #include<unordered_map>
 #include<cmath>
 #include<unordered_set>
 #include<fstream>
 #include<sstream>
 
using namespace std;
typedef long long int ll;
ll mod=1e9+7;
 
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0){
        if (y & 1)  res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
 
ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}
 
ll gcd (ll a, ll b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}
 

// Creating a hashmap of pairs using ---- geeksforgeeks.org/how-to-create-an-unordered_map-of-pairs-in-c/

struct hash_pair {
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};

ll fact(ll n)
{
    ll res = 1;
    for (ll i = 2; i <= n; i++)
        res = res * i;
    return res;
}
 
ll printNcR(ll n, ll r)
{
 
    ll p = 1, k = 1;
 
    if (n - r < r)
        r = n - r;
 
    if (r != 0) {
        while (r) {
            p = (p*n);
            k = (k*r);
 
            ll m = gcd(p, k);
 
            p /= m;
            k /= m;
 
            n--;
            r--;
        }
    }
 
    else
        p = 1;
    return p;
}
 
// Returns nCr % p using Fermat's little
// theorem.
ll nCrModPFermat(ll n,ll r, ll p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;
 
    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    ll fac[n + 1];
    fac[0] = 1;
    for (int i = 1; i <= n; i++)
        fac[i] = (fac[i - 1] * i) % p;
 
    return (fac[n] * modInverse(fac[r], p) % p
            * modInverse(fac[n - r], p) % p)
           % p;
}
 
ll spf[1000001];
  
const ll MAXN=1000001;
vector<ll>prime;
 
void sieve()
{
    spf[1] = 1ll;
    for (ll i=2ll; i<MAXN; i++)
  
        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;
  
    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;
  
    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)
  
                // marking spf[j] if it is not
                // previously marked
                if (spf[j]==j)
                    spf[j] = i;
        }
    }
}
 
map<ll,ll> getFactorization(ll x)
{
    map<ll,ll> ret;
    while (x != 1)
    {
        ret[spf[x]]++;
        x = x / spf[x];
    }
    return ret;
}
 
struct DSU{
    
    vector<ll>parent,rank,order;
    ll mx=1;
    
    void init(ll n){
        for(ll i=0;i<n;i++){
            parent.push_back(i);
            rank.push_back(0);
            order.push_back(1);
        }
    }
    
    ll get(ll a){
        return parent[a]=(parent[a]==a ? a : get(parent[a]));
    }
    
    void Union(ll a, ll b){
        
        a=get(a);
        b=get(b);
        
        if(a==b){return;}
        
        if(rank[a]==rank[b]){
            rank[a]++;
    
        }
        if(rank[a]>rank[b]){
            parent[b]=a;
            order[a]+=order[b];
            mx=max(mx,order[a]);
           
            
        }else{
            parent[a]=b;
            order[b]+=order[a];
            mx=max(mx,order[b]);
        }
    }
    
};

bool get(ll i, vector<ll>&v, ll k, ll s, vector<vector<bool>>&dp,ll n){
    if(s==0 && k==0){
        return true;
    }
    if(s<=0){
        return false;
    }
    if(k<=0){
        return false;
    }
    if(i>n){
        return false;
    }
    if(dp[i-1][s]){
        return false;
    }
    dp[i-1][s]=true;
    v.push_back(i);
    if(get(i+1,v,k-1,s-i,dp,n)){
        return true;
    }
    v.pop_back();
    return get(i+1,v,k,s,dp,n);
}

void solve(){
    vector<ll>odd,even;
    ll n;
    cin>>n;
    for(ll i=0;i<n;i++){
        ll x;
        cin>>x;
        if(x&1){
            odd.push_back(x);
        }
        else{
            even.push_back(x);
        }
    }
    for(auto i: odd){
        cout<<i<<" ";
    }
    for(auto i: even){
        cout<<i<<" ";
    }
    cout<<"\n";
}
  
 
int main()
{
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int t;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}