#include <iostream>
#include <fstream>
using namespace std;
ifstream f("zone.in");
ofstream g("zone.out");
int n, i, pozpar, pozimpar, v[301], gasitpar, gasitimpar;
int main()
{
f >> n;
for (i=1; i<=3*n; ++i)
f >> v[i];
gasitpar=0; i=1;
while (!gasitpar && i<=n)
{
if (v[i]%2==0) { gasitpar=1; pozpar=i;}
++i;
}
gasitimpar=0; i=3*n;
while (!gasitimpar && i>2*n)
{
if (v[i]%2==1) { gasitimpar=1; pozimpar=i;}
--i;
}
if (gasitpar && gasitimpar)
{
int temp=v[pozpar];
v[pozpar]=v[pozimpar];
v[pozimpar]=temp;
}
for (i=1; i<=3*n; ++i)
g << v[i] << " ";
}