#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  int odd = 0;
  for (auto &i : a) cin >> i, odd += i & 1;
  if (odd > 0 && odd < n) sort(a.begin(), a.end());
  for (auto &i : a) cout << i << " \n"[&i == &a.back()];
  return 0;
}
