#include <bits/stdc++.h>
using namespace std;
int a[1000010];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int sum1, sum2;
  sum1 = sum2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] % 2)
      sum1++;
    else
      sum2++;
  }
  if (sum1 && sum2) sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
