#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  bool odd = false, even = false;
  for (int &x : a) {
    cin >> x;
    if (x % 2 == 0)
      even = true;
    else
      odd = true;
  }
  if (odd and even) sort(a.begin(), a.end());
  for (int x : a) cout << x << ' ';
  cout << '\n';
  return 0;
}
