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