#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, a[N];
int main() {
  while (~scanf("%d", &n)) {
    bool OK1 = 0, OK2 = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] % 2)
        OK1 = 1;
      else
        OK2 = 1;
    }
    if (OK1 && OK2) sort(a + 1, a + 1 + n);
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
    printf("\n");
  }
  return 0;
}
