#include <bits/stdc++.h>
using namespace std;
long long sum;
long long a[202000], dp[202000], n, i, j;
char c[200000];
long long x, ans;
set<long long> s;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      x = 1;
    else
      ans = 1;
  }
  if (x && ans) sort(a, a + n);
  for (i = 0; i < n; i++) cout << a[i] << " ";
}
