#include <bits/stdc++.h>
using namespace std;
int a[100005], n;
int main() {
  bool ex = false, ex2 = false;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      ex = true;
    else
      ex2 = true;
  }
  if (ex && ex2) sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) cout << a[i] << ' ';
  cout << '\n';
  return 0;
}
