#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, sum1 = 0, sum2 = 0, diff = 0, cnt = 0, c1 = 0, c2 = 0,
                      sum = 0;
  cin >> n;
  long long int arr[n], a[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    a[i] = arr[i] / 2;
    if (a[i] > 0)
      sum1 += a[i];
    else
      sum2 += a[i];
  }
  diff = sum1 + sum2;
  if (diff > 0)
    for (i = 0; i < n; i++) {
      if (a[i] <= 0 && arr[i] % 2 != 0 && arr[i] < 0) {
        a[i]--;
        cnt++;
      }
      if (cnt == diff) break;
    }
  else if (diff < 0)
    for (i = 0; i < n; i++) {
      if (a[i] >= 0 && arr[i] % 2 != 0 && arr[i] > 0) {
        a[i]++;
        cnt++;
      }
      if (cnt == abs(diff)) break;
    }
  for (i = 0; i < n; i++) cout << a[i] << endl;
  cnt = 0;
  sum1 = 0;
  sum2 = 0;
}
