#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, a[100005];
  int bum[2];
  bum[0] = 0;
  bum[1] = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    bum[a[i] % 2]++;
  }
  if (bum[0] && bum[1]) sort(a, a + n);
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
