#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n + 2], od = 0, ev = 0;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] % 2)
        od++;
      else
        ev++;
    }
    if (od > 0 and ev > 0) sort(a, a + n);
    for (long long int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
  }
}
