Problem: Vasya has gotten interested in programming contests in TCMCF+++ rules. On the contest n problems were suggested and every problem had a cost — a certain integral number of points (perhaps, negative or even equal to zero). According to TCMCF+++ rules, only accepted problems can earn points and the overall number of points of a contestant was equal to the product of the costs of all the problems he/she had completed. If a person didn't solve anything, then he/she didn't even appear in final standings and wasn't considered as participant. Vasya understood that to get the maximal number of points it is not always useful to solve all the problems. Unfortunately, he understood it only after the contest was finished. Now he asks you to help him: find out what problems he had to solve to earn the maximal number of points.

Input

The first line contains an integer n (1 ≤ n ≤ 100) — the number of the suggested problems. The next line contains n space-separated integers ci ( - 100 ≤ ci ≤ 100) — the cost of the i-th task. The tasks' costs may coinсide.

Output

Print space-separated the costs of the problems that needed to be solved to get the maximal possible number of points. Do not forget, please, that it was necessary to solve at least one problem. If there are several solutions to that problem, print any of them.

Examples

Input

5
1 2 -3 3 3


Output

3 1 2 3 


Input

13
100 100 100 100 100 100 100 100 100 100 100 100 100


Output

100 100 100 100 100 100 100 100 100 100 100 100 100 


Input

4
-2 -2 -2 -2


Output

-2 -2 -2 -2 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int inf = 1000000000;
const long long infLL = 1000000000000000000;
long long MOD = 1000000000;
inline bool checkbit(long long n, int i) { return n & (1LL << i); }
inline long long setbit(long long n, int i) { return n | (1LL << i); }
inline long long resetbit(long long n, int i) { return n & (~(1LL << i)); }
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline bool isInside(pair<int, int> p, long long n, long long m) {
  return (p.first >= 0 && p.first < n && p.second >= 0 && p.second < m);
}
inline bool isInside(pair<int, int> p, long long n) {
  return (p.first >= 0 && p.first < n && p.second >= 0 && p.second <= n);
}
inline bool isSquare(long long x) {
  long long s = sqrt(x);
  return (s * s == x);
}
inline bool isFib(long long x) {
  return isSquare(5 * x * x + 4) || isSquare(5 * x * x - 4);
}
inline bool isPowerOfTwo(long long x) { return (x && !(x & (x - 1))); }
inline bool normal(long long &a, long long MOD) {
  a %= MOD;
  (a < 0) && (a += MOD);
}
inline long long modMul(long long a, long long b, long long MOD) {
  a %= MOD, b %= MOD;
  normal(a, MOD), normal(b, MOD);
  return (a * b) % MOD;
}
inline long long modAdd(long long a, long long b, long long MOD) {
  a %= MOD, b %= MOD;
  normal(a, MOD), normal(b, MOD);
  return (a + b) % MOD;
}
inline long long modSub(long long a, long long b, long long MOD) {
  a %= MOD, b %= MOD;
  normal(a, MOD), normal(b, MOD);
  a -= b;
  normal(a, MOD);
  return a;
}
inline long long modPow(long long b, long long p, long long MOD) {
  long long r = 1;
  while (p) {
    if (p & 1) r = modMul(r, b, MOD);
    b = modMul(b, b, MOD);
    p >>= 1;
  }
  return r;
}
inline long long modInverse(long long a, long long MOD) {
  return modPow(a, MOD - 2, MOD);
}
inline long long modDiv(long long a, long long b, long long MOD) {
  return modMul(a, modInverse(b, MOD), MOD);
}
struct func {
  bool operator()(pair<int, int> const &a, pair<int, int> const &b) {
    if (a.first == b.first) {
      return (a.second < b.second);
    }
    return (a.first < b.first);
  }
};
vector<int> pos, neg, zero;
int a[1123], n;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] < 0) {
      neg.push_back(a[i]);
    }
    if (a[i] > 0) {
      pos.push_back(a[i]);
    } else if (a[i] == 0) {
      zero.push_back(a[i]);
    }
  }
  sort(a, a + n);
  sort(pos.begin(), pos.end());
  sort(neg.begin(), neg.end());
  if (neg.size() % 2 == 0) {
    for (int i = 0; i < neg.size(); ++i) {
      cout << neg[i] << " ";
    }
  } else {
    for (int i = 0; i < neg.size() - 1; ++i) {
      cout << neg[i] << " ";
    }
  }
  if (pos.size() == 0 && zero.size() == 0 && neg.size() == 1) {
    cout << neg[0] << '\n';
  }
  if ((pos.size() == 0 && neg.size() == 1) ||
      (pos.size() == 0 && neg.size() == 0)) {
    if (zero.size()) {
      cout << 0 << '\n';
    }
  }
  for (int i = 0; i < pos.size(); ++i) {
    cout << pos[i] << " ";
  }
  cout << '\n';
  return 0;
}