#include <bits/stdc++.h>
using namespace std;
void print(string s) {
  cout << s << endl;
  exit(0);
}
bool t[110];
void solve() {
  int n, p[110], ans[110], k = 0;
  cin >> n;
  for (int(i) = 0; i < (n); i++) cin >> p[i + 1];
  for (int(i) = 0; i < (n); i++)
    if (p[i + 1] > 0) {
      ans[k++] = p[i + 1];
      t[i + 1] = true;
    }
  for (;;) {
    int m1 = 0, m2 = 0;
    for (int(i) = 0; i < (n); i++)
      if (!t[i + 1] && p[i + 1] < 0)
        if (m1 == 0 || p[i + 1] < p[m1]) m1 = i + 1;
    for (int(i) = 0; i < (n); i++)
      if (!t[i + 1] && p[i + 1] < 0 && i + 1 != m1)
        if (m2 == 0 || p[i + 1] < p[m2]) m2 = i + 1;
    if (m1 != 0 && m2 != 0) {
      t[m1] = t[m2] = true;
      ans[k++] = p[m1];
      ans[k++] = p[m2];
    } else
      break;
  }
  if (k == 0) {
    for (int(i) = 0; i < (n); i++)
      if (p[i + 1] == 0) {
        ans[k++] = 0;
        t[i + 1] = true;
        break;
      }
  }
  if (k == 0) {
    int mm = 0;
    for (int(i) = 0; i < (n); i++)
      if (mm == 0 || p[i + 1] > p[mm]) mm = i + 1;
    ans[k++] = p[mm];
    t[mm] = true;
  }
  for (int(i) = 0; i < (k); i++) cout << ans[i] << " ";
}
int main() {
  solve();
  return 0;
}
