#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, i, a, x = 0;
  cin >> n;
  vector<int> v;
  for (i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
    if (v[i] % 2 == 0) x++;
  }
  if (x != 0 && x != n) sort(v.begin(), v.end());
  for (i = 0; i < n; i++) cout << v[i] << " ";
}
