#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[101];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  vector<int> res;
  for (int i = n - 1; i >= 0; --i) {
    if (arr[i] > 0) res.push_back(arr[i]);
  }
  for (int i = 0; i < n - 1; i += 2) {
    if (arr[i] < 0 && arr[i + 1] < 0) {
      res.push_back(arr[i]);
      res.push_back(arr[i + 1]);
    }
  }
  if (res.size() == 0) {
    res.push_back(arr[n - 1]);
  }
  for (int i = 0; i < res.size(); i++) {
    cout << res[i];
    if (i == res.size() - 1)
      cout << "\n";
    else
      cout << " ";
  }
  return 0;
}
