#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, odd = 0, even = 0;
  vector<int> v;
  cin >> n;
  int k, lastsize;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  lastsize = v.size();
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < v.size(); i++) {
    if (v[i] % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  if (odd > even)
    k = 0;
  else {
    k = 1;
  }
  while (v.size() != 0) {
    for (int i = 0; i < v.size(); i++) {
      if (v[i] % 2 != k) {
        k = v[i] % 2;
        v.erase(v.begin() + i);
      }
    }
    if (lastsize == v.size()) {
      break;
    }
    lastsize = v.size();
  }
  if (v.size() != 0) {
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
  } else {
    cout << "0";
  }
  return 0;
}
