#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> x;
  int odd = 0;
  int even = 0;
  for (int i = 0; i < n; i++) {
    int y;
    cin >> y;
    if (y % 2)
      odd++;
    else
      even++;
    x.push_back(y);
  }
  if (odd > 0 && even > 0) {
    sort(x.begin(), x.end());
    for (int i = 0; i < x.size(); i++) {
      cout << x[i] << " ";
    }
  } else {
    for (int i = 0; i < x.size(); i++) {
      cout << x[i] << " ";
    }
  }
  return 0;
}
