#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long seve[1000000] = {0};
set<long long> check;
void seive() {
  long long i, j;
  seve[0] = 1;
  seve[1] = 1;
  for (i = 2; i <= 1000000; i++) {
    if (seve[i] == 0) {
      check.insert(i);
      for (j = i * i; j <= 1000000; j = j + i) seve[j] = 1;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long m, i, j = 0, f = 0, k = 0, y, x, n;
  string s;
  cin >> n;
  long long a[n];
  x = 0, y = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2)
      x = 1;
    else
      y = 1;
  }
  if (x == 0 || y == 0) {
    for (i = 0; i < n; i++) cout << a[i] << " ";
  } else {
    sort(a, a + n);
    for (i = 0; i < n; i++) cout << a[i] << " ";
  }
}
