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