#include <bits/stdc++.h>
using namespace std;
int a[14000], b[14000];
int main() {
  int n;
  cin >> n;
  int debt = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i] / 2;
    if (a[i] % 2 != 0) {
      if (debt == 0) {
        if (a[i] < 0) {
          debt = 1;
        } else {
          debt = -1;
        }
      } else {
        if (debt == 1) {
          if (a[i] < 0) {
            --b[i];
          }
        } else {
          if (a[i] > 0) {
            ++b[i];
          }
        }
        debt = 0;
      }
    }
  }
  for (int i = 0; i < n; ++i) cout << b[i] << endl;
  return 0;
}
