#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  long long int i;
  cin >> n;
  long long int* ar = new long long int[n];
  long long int temp = 0;
  long long int temp1 = 0;
  for (i = 0; i < n; i++) {
    cin >> ar[i];
    if (ar[i] % 2 != 0) {
      temp = 1;
    } else {
      temp1 = 1;
    }
  }
  if (temp == 1 && temp1 == 1) {
    sort(ar, ar + n);
  }
  for (i = 0; i < n; i++) {
    cout << ar[i] << " ";
  }
  cout << endl;
  delete[] ar;
  return 0;
}
