#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> pl, mi;
  cin >> n;
  int nul = 0;
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    if (q == 0)
      nul++;
    else if (q > 0)
      pl.push_back(q);
    else
      mi.push_back(q);
  }
  sort(pl.begin(), pl.end());
  reverse(pl.begin(), pl.end());
  sort(mi.begin(), mi.end());
  int cur = 0;
  for (int i = 0; i < pl.size(); i++) {
    cout << pl[i] << " ";
    cur++;
  }
  for (int i = 0; i < (int)mi.size() - 1; i += 2) {
    cout << mi[i] << " " << mi[i + 1] << " ";
    cur += 2;
  }
  if (cur == 0) {
    if (pl.size() != 0)
      cout << pl[0];
    else if (nul != 0)
      cout << 0;
    else
      cout << mi.back();
  }
  return 0;
}
