#include <bits/stdc++.h>
using namespace std;
long long n, x;
signed main() {
  long long t = 1;
  while (t--) {
    cin >> n;
    vector<long long> a(n);
    for (long long i = 0; i < n; i++) cin >> a[i];
    bool even_found = 0, odd_found = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] % 2)
        odd_found = 1;
      else
        even_found = 1;
    }
    if (odd_found && even_found) {
      sort(a.begin(), a.end());
    }
    for (long long i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
  }
  return 0;
}
