#include <bits/stdc++.h>
using namespace std;
vector<int> Ne, ans;
int main() {
  int n, zero = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    if (x > 0)
      ans.push_back(x);
    else if (x < 0)
      Ne.push_back(x);
    else
      zero = 1;
  }
  if (Ne.size() > 1) {
    sort(Ne.begin(), Ne.end());
    for (int i = 0; i + 1 < Ne.size(); i += 2) {
      ans.push_back(Ne[i]);
      ans.push_back(Ne[i + 1]);
    }
  }
  if (ans.empty()) {
    if (zero)
      ans.push_back(0);
    else
      ans.push_back(Ne.back());
  }
  printf("%d", ans[0]);
  for (int i = 1; i < ans.size(); ++i) printf(" %d", ans[i]);
  printf("\n");
  return 0;
}
