#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, h;
  cin >> t;
  int flag1 = 0, flag2 = 0;
  while (t--) {
    cin >> h;
    if (h % 2 == 0)
      cout << h / 2 << endl;
    else {
      if (h > 0) {
        if (flag1 == 0) {
          cout << h / 2 << endl;
          flag1 = 1;
        } else {
          {
            cout << h / 2 + 1 << endl;
            flag1 = 0;
          }
        }
      } else {
        if (flag2 == 0) {
          cout << h / 2 << endl;
          flag2 = 1;
        } else {
          {
            cout << h / 2 - 1 << endl;
            flag2 = 0;
          }
        }
      }
    }
  }
  return 0;
}
