#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &x : a) cin >> x;
  bool odd_exists = false, even_exists = false;
  for (int x : a) {
    if (x & 1)
      odd_exists = true;
    else
      even_exists = true;
  }
  if (*min_element(a.begin(), a.end()) == *max_element(a.begin(), a.end()) ||
      !(odd_exists & even_exists)) {
    for (int x : a) {
      cout << x << ' ';
    }
    return 0;
  }
  sort(a.begin(), a.end());
  for (int x : a) {
    cout << x << ' ';
  }
}
