#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, zer = 0;
  vector<int> pos;
  vector<int> neg;
  cin >> n;
  int x;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (x > 0)
      pos.push_back(x);
    else if (x < 0)
      neg.push_back(x);
    else
      ++zer;
  }
  sort(neg.begin(), neg.end());
  vector<int> out = pos;
  for (int i = 0; i < neg.size(); ++i) {
    if (pos.empty() && neg.size() == 1) {
      out.push_back(neg[i]);
      continue;
    }
    if (neg.size() % 2 == 1 && i == neg.size() - 1) break;
    out.push_back(neg[i]);
  }
  int s = 0;
  for (int i = 0; i < out.size(); ++i) s += out[i];
  if (out.empty() || (s <= 0 && out.size() == 1 && zer > 0))
    cout << 0;
  else
    for (int i = 0; i < out.size(); ++i) cout << out[i] << " ";
}
