#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i] % 2;
  }
  if (*min_element(b, b + n) != *max_element(b, b + n)) {
    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] << " ";
    }
  }
}
