#include <bits/stdc++.h>
using namespace std;
const int mod = 1e+9 + 7;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
void solve() {
  int n, temp, odd = 0, even = 0;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] % 2)
      odd++;
    else
      even++;
  }
  if (odd > 0 && even > 0) sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) cout << v[i] << " ";
}
int main() {
  int t = 1;
  while (t--) solve();
}
