#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  vector<int> v;
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (n == 1) {
      cout << a[i];
      return 0;
    }
    if (a[i] == 0) {
      c++;
    } else if (a[i] < 0 && a[i + 1] < 0 && i + 1 < n) {
      v.push_back(a[i]);
      v.push_back(a[i + 1]);
      i++;
    } else if (a[i] > 0) {
      v.push_back(a[i]);
    }
  }
  if (v.size() == 0) {
    for (int i = 0; i < c; i++) {
      cout << 0 << " ";
    }
  } else {
    for (auto u : v) {
      cout << u << " ";
    }
  }
  return 0;
}
