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