#include <bits/stdc++.h>
int main() {
  int temp, n;
  scanf("%d", &n);
  int sw = 0;
  int sw_n = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);
    if (!(temp % 2)) {
      temp = temp / 2;
    } else {
      if (temp > 0) {
        if (sw) {
          temp = temp / 2;
          sw = 0;
        } else {
          sw = 1;
          temp = temp / 2 + 1;
        }
      } else {
        if (sw_n) {
          temp = temp / 2;
          sw_n = 0;
        } else {
          sw_n = 1;
          temp = temp / 2 - 1;
        }
      }
    }
    printf("%d\n", temp);
  }
}
