#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int main(void) {
  int n;
  cin >> n;
  int odd = 0;
  int even = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2) {
      odd = 1;
    } else
      even = 1;
  }
  if (even && odd) {
    sort(a, a + n);
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  } else
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
