#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool ex[2];
  cin >> n;
  int array[n];
  for (int i = 0; i < n; i++) {
    cin >> array[i];
    ex[array[i] % 2] = 1;
  }
  if (ex[0] && ex[1]) sort(array, array + n);
  for (int i = 0; i < n; i++) {
    cout << array[i] << " ";
  }
  return 0;
}
