#include <bits/stdc++.h>
using namespace std;
vector<long long int> v, vec1, vec2;
int main() {
  long long int n, a;
  cin >> n;
  int visited[n];
  memset(visited, 0, sizeof visited);
  long long int jor = 0, bijor = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a & 1) {
      bijor++;
    } else {
      jor++;
    }
    v.push_back(a);
  }
  if (jor == 0 || bijor == 0) {
    for (auto i : v) cout << i << " ";
  } else {
    sort(v.begin(), v.end());
    for (auto i : v) cout << i << " ";
  }
  return 0;
}
