#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  vector<int> odd, even;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      even.push_back(a[i]);
    else
      odd.push_back(a[i]);
  }
  if (odd.size() == n) {
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  } else if (even.size() == n) {
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
  } else {
    sort(a, a + n);
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  }
}
