#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int array[n];
  bool even = false, odd = false;
  for (int i = 0; i < n; ++i) {
    cin >> array[i];
    if (array[i] % 2 == 0)
      even = true;
    else
      odd = true;
  }
  if (even && odd) {
    sort(array, array + n);
  }
  for (int i = 0; i < n; ++i) {
    cout << array[i] << " ";
  }
  return 0;
}
