#include <bits/stdc++.h>
using namespace std;
const long long N = 300100, MOD = 1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> arr(n);
  int odd = 0, even = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] % 2 == 0)
      even++;
    else
      odd++;
  }
  if (odd > 0 && even > 0) sort(arr.begin(), arr.end());
  for (auto& a : arr) {
    cout << a << " ";
  }
}
