#include <iostream>
using namespace std;
int main()
{
int n; cin >> n;
int sir[n];
int pare = 0;
for(int i = 0; i < n; i++)
{
cin>>sir[i];
pare += (1 - sir[i] % 2);
}
int pareVec[pare];
int impareVec[n - pare];
int p1 = 0, p2 = 0;
for(int i = 0; i < n; i++)
{
if(sir[i] % 2 == 0)pareVec[p1++] = sir[i];
else impareVec[p2++] = sir[i];
}
for(int i = 0; i < n; i++)
{
if(i < pare)
cout << pareVec[i];
else
cout << impareVec[--p2];
}
}