#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void read(T&... a) {
  ((cin >> a), ...);
}
template <typename... T>
void write(T&... a) {
  ((cout << a << " "), ...);
  cout << "\n";
}
void solve() {
  int n;
  cin >> n;
  long long arr[n];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] & 1) cnt++;
  }
  if (cnt == 0 || cnt == n) {
    for (int i = 0; i < n; i++) {
      cout << arr[i] << " ";
    }
    cout << "\n";
  } else {
    sort(arr, arr + n);
    for (int i = 0; i < n; i++) {
      cout << arr[i] << " ";
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
  solve();
  return 0;
}
