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