#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> x1, pair<int, int> x2) { return x1.first < x2.first; }
int main() {
  int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  bool f = false;
  for (int i = 0; i < n; i++)
    if (a[i] % 2 == 1) f = true;
  bool f1 = false;
  for (int i = 0; i < n; i++)
    if (a[i] % 2 == 0) f1 = true;
  if (f && f1) sort(a, a + n);
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
  return 0;
}
