#include <bits/stdc++.h>
using namespace std;
const int md = 1e8;
const int MAX = 1e5 + 1;
int main() {
  long long int n;
  cin >> n;
  int arr[n];
  long long int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] & 1) ++cnt;
  }
  if (cnt > 0 && cnt < n) sort(arr, arr + n);
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  return 0;
}
