#include <bits/stdc++.h>
using namespace std;
const long long int MAX = 1e6;
long long int x[MAX];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  bool e = 0, o = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    if (x[i] % 2 == 0)
      e = 1;
    else
      o = 1;
  }
  if (e == 1 && o == 1) {
    sort(x, x + n);
  }
  for (int i = 0; i < n; i++) cout << x[i] << " ";
  return 0;
}
