#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];
  vector<int> ans;
  vector<int> negative;
  for (int i = 0; i < n; ++i) {
    if (a[i] > 0)
      ans.push_back(a[i]);
    else if (a[i] < 0)
      negative.push_back(a[i]);
  }
  if (n == 1)
    cout << a[0];
  else if ((ans.empty() && (negative.empty() || negative.size() == 1)))
    cout << 0;
  else {
    sort(negative.begin(), negative.end());
    for (int i = 1; i < negative.size(); i += 2) {
      ans.push_back(negative[i]);
      ans.push_back(negative[i - 1]);
    }
    for (auto x : ans) cout << x << " ";
  }
  return 0;
}
