#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n, long long m) {
  if (n == 0) return m;
  return gcd(m % n, n);
}
bool ifprime(long long n) {
  if (n == 1) return false;
  long long i;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
void disp(vector<long long> v) {
  for (auto u : v) cout << u << " ";
  cout << "\n";
}
void remleadzero(vector<int> &v) {
  vector<int> u;
  int i = 0;
  while (v[i] == 0) i++;
  while (i < v.size()) {
    u.push_back(v[i]);
    i++;
  }
  v = u;
}
long long fast_expo(long long n, long long m) {
  long long a = 1;
  while (m > 0) {
    if (m & 1) a = (a * n) % 1000000007;
    n = (n * n) % 1000000007;
    m /= 2;
  }
  return a % 1000000007;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long a[n];
  long long od = 0, ev = 0;
  for (auto &u : a) {
    cin >> u;
    if (u & 1) od++;
  }
  if (od < n and od > 0) {
    sort(a, a + n);
  }
  for (auto u : a) cout << u << " ";
  return 0;
}
