#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, p, t, a = 0, b = 0;
  cin >> n;
  vector<long long int> vec;
  for (i = 0; i < n; i++) {
    cin >> p;
    if (p % 2 == 0)
      a++;
    else
      b++;
    vec.push_back(p);
  }
  if (a == 0 || b == 0) {
    for (i = 0; i < n; i++) cout << vec[i] << " ";
  } else {
    sort(vec.begin(), vec.end());
    for (i = 0; i < n; i++) cout << vec[i] << " ";
  }
}
