#include <bits/stdc++.h>
using namespace std;
int n, v[100000 + 10], odd, even;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    if (v[i] & 1)
      odd = 1;
    else
      even = 1;
  }
  if (odd && even) sort(v + 1, v + n + 1);
  for (int i = 1; i <= n; i++) cout << v[i] << ' ';
  cout << '\n';
  return 0;
}
