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