#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long MIN(long long x, long long y) {
  if (x > y) {
    return y;
  } else {
    return x;
  }
}
long long MAX(long long x, long long y) {
  if (y > x) {
    return y;
  } else {
    return x;
  }
}
int main() {
  int t = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(8);
  cout << fixed;
  while (t--) {
    long long i = 0, j = 0, k = 0, n = 0, m = 0, x = 0, sum = 0, res = 0, p = 0,
              q = 0, l = 0, r = 0, d = 0, a = 0, b = 0, count = 0, max = 0,
              z = 0;
    double ans = 0, a1, b1;
    string s1, s2;
    set<long long> ss, se;
    vector<long long> v1, v2;
    map<long long, long long> mp1, mp2;
    cin >> n;
    while (i < n) {
      cin >> x;
      if (x % 2 == 0) {
        p++;
      } else {
        q++;
      }
      v1.push_back(x);
      i++;
    }
    if (p == n || q == n) {
      i = 0;
      while (i < n) {
        cout << v1[i] << " ";
        i++;
      }
      cout << "\n";
    } else {
      sort(v1.begin(), v1.end());
      i = 0;
      while (i < n) {
        cout << v1[i] << " ";
        i++;
      }
      cout << "\n";
    }
  }
  return 0;
}
