#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  bool ok[2] = {0};
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    ok[a[i] % 2] = 1;
  }
  if (ok[0] && ok[1]) {
    sort(a, a + n);
  }
  for (long long i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << '\n';
  ;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
