#include <bits/stdc++.h>
using namespace std;
const int N = 2e4;
int a[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0) {
      a[i] /= 2;
    } else if (a[i] < 0) {
      int b = abs(a[i]);
      b = b / 2 + 1;
      a[i] = -b + flag;
      flag ^= 1;
    } else {
      a[i] = a[i] / 2 + flag;
      flag ^= 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d\n", a[i]);
  }
  return 0;
}
