#include <bits/stdc++.h>
using namespace std;
long long int po(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long int p = po(x, n / 2) % 1000000007;
    return (p * p) % 1000000007;
  } else {
    return ((po(x, n - 1) % 1000000007) * x % 1000000007) % 1000000007;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  int no = 0, ne = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) {
      ne++;
    } else {
      no++;
    }
  }
  if (no == 0 || ne == 0) {
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
  } else {
    sort(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
