#include <bits/stdc++.h>
using namespace std;
int n;
int a[100], r, t, ind;
int m = -1000;
int main() {
  cin >> n;
  int fl = 0;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    if (c > 0) {
      cout << c << ' ';
      fl = 1;
    } else if (c < 0) {
      a[r++] = c;
      if (c > m) {
        ind = r - 1;
        m = c;
      }
    } else
      t++;
  }
  swap(a[ind], a[0]);
  if (r % 2)
    ind = 1;
  else
    ind = 0;
  int fl2 = 0;
  for (int i = ind; i < r; i++) {
    cout << a[i] << ' ';
    fl2 = 1;
  }
  if (!fl && !fl2) {
    if (t > 0)
      cout << "0";
    else
      cout << a[0];
  }
  return 0;
}
