#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    long long n;
    cin >> n;
    long long a[n], s1 = 0, s2 = 0, odd = 0, even = 0, temp = 0, flag = 0,
                    od = 0, ev = 0;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
      if (a[i] % 2 == 0)
        ev++;
      else
        od++;
    }
    if ((od == n) || (ev == n)) {
      for (int i = 0; i < n; i++) cout << a[i] << " ";
    } else {
      sort(a, a + n);
      for (int i = 0; i < n; i++) cout << a[i] << " ";
    }
  }
}
