#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
vector<int> a;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int opp = 0;
  int odds = 0;
  for (int i = 0; i < n; i++) {
    int sk;
    cin >> sk;
    a.push_back(sk);
    if (sk % 2 == 1) {
      odds++;
    } else
      opp++;
  }
  if (odds >= 1 && opp >= 1) {
    sort(a.begin(), a.end());
  }
  for (int i : a) cout << i << " ";
  return 0;
}
