#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
long long a[105], b[105], c[105];
int main() {
  long long n, i, g, num1, num2, num3;
  num1 = num2 = num3 = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> g;
    if (g > 0)
      a[num1++] = g;
    else if (g < 0)
      b[num2++] = g;
    else
      c[num3++] = g;
  }
  sort(b, b + num2);
  for (i = 0; i < num1; i++) {
    printf("%lld ", a[i]);
  }
  if (num1 == 0 && num3 == 0 && num2 == 1) {
    cout << b[0] << endl;
    return 0;
  }
  if (num2 >= 2) {
    for (i = 0; i < num2; i++) {
      if (num2 % 2) {
        if (i == num2 - 1) break;
      }
      printf("%lld ", b[i]);
    }
  }
  if (num1 == 0 && num2 <= 1 && num3 > 0) cout << 0 << endl;
}
