#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int balance = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    if (k % 2 != 0) {
      if (balance == 0) {
        cout << k / 2 << endl;
        if (k < 0) {
          balance++;
        } else {
          balance--;
        }
      } else if (balance > 0) {
        if (k < 0) {
          cout << (k / 2) - 1 << endl;
          balance--;
        } else {
          cout << k / 2 << endl;
          balance--;
        }
      } else if (balance < 0) {
        if (k < 0) {
          cout << k / 2 << endl;
          balance++;
        } else {
          cout << (k / 2) + 1 << endl;
          balance++;
        }
      }
    } else {
      cout << k / 2 << endl;
    }
  }
}
