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