#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <class T, class U>
inline istream& operator>>(istream& os, pair<T, U>& p) {
  os >> p.first >> p.second;
  return os;
}
template <class T>
inline ostream& operator<<(ostream& os, const vector<T>& v) {
  if (v.empty()) return os;
  if (v.begin() != v.end()) os << v.front();
  for (auto it = ++v.begin(); it != v.end(); ++it) os << ' ' << *it;
  return os;
}
template <class T>
inline istream& operator>>(istream& is, vector<T>& v) {
  for (auto& i : v) is >> i;
  return is;
}
int64_t gcd(int64_t a, int64_t b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
void Solve(istream& is, ostream& os) {
  int n;
  is >> n;
  vector<int> input(n);
  is >> input;
  bool is_odd = input.front() & 1, same_parity = true;
  for (int i = 1; i < n; ++i) {
    if ((input[i] & 1) != is_odd) {
      same_parity = false;
    }
  }
  if (same_parity) {
    os << input;
    return;
  }
  sort((input).begin(), (input).end());
  os << input;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(15) << fixed;
  Solve(cin, cout);
  return 0;
}
