#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<long long> A(n);
  int nOdd = 0, nEven = 0;
  for (int i = (int)(0); i < (int)(n); i++) {
    cin >> A[i];
    if (A[i] % 2 == 0)
      nEven++;
    else
      nOdd++;
  }
  if (nOdd > 0 && nEven > 0) sort(A.begin(), A.end());
  for (int i = (int)(0); i < (int)(n); i++) cout << A[i] << ' ';
  cout << endl;
  return 0;
}
