#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> a, b;
  scanf("%d", &n);
  int i, x;
  int v = 0;
  int pr = 0;
  int don = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (v == 0) {
      pr = x;
      v = 1;
    } else
      pr = max(pr, x);
    if (x > 0)
      a.push_back(x);
    else if (x < 0)
      b.push_back(x);
  }
  don = a.size();
  for (i = 0; i < a.size(); i++) printf("%d ", a[i]);
  if (b.size() > 1) {
    sort(b.begin(), b.end());
    n = b.size();
    if (n % 2) n--;
    don += n;
    for (i = 0; i < n; i++) printf("%d ", b[i]);
  }
  if (don == 0) printf("%d", pr);
  return 0;
}
