#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1e3 + 2;
const long long int mod = 1e3 + 2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n + 2];
  bool o = false, e = false;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2)
      o = true;
    else
      e = true;
  }
  if (o and e) {
    sort(a, a + n);
    for (long long int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
    return 0;
  }
  for (long long int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
