#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  int odd = 0, even = 0, item;
  for (int i = 0; i < v.size(); i++) {
    item = v[i];
    if (item % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  if (even != 0 && even != n) {
    sort(v.begin(), v.end());
  }
  for (auto i : v) {
    cout << i << " ";
  }
  return 0;
}
