#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, c = 0, c1;
  cin >> n;
  long long int ara[n], i, ara2[n];
  for (i = 0; i < n; i++) {
    cin >> ara[i];
    ara2[i] = ara[i];
    if (ara[i] % 2 == 0) c++;
  }
  c1 = n - c;
  sort(ara2, ara2 + n);
  if (c == 0 || c == n) {
    for (i = 0; i < n; i++) {
      cout << ara[i] << " ";
    }
  } else {
    for (i = 0; i < n; i++) {
      cout << ara2[i] << " ";
    }
  }
}
