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