#include <bits/stdc++.h>
using namespace std;
bool isprime(int n) {
  if (n == 1) return false;
  if (n == 2) return true;
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
void answer(int f) {
  if (f) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  cout << endl;
}
long long int solve(long long int n, long long int i, long long int ans) {
  if (n == 0) return ans;
  if (n % 3 == 0)
    solve((n / 3) - 1, i + 1, ans);
  else if (i > 0)
    solve(n - 1, i - 1, ans + 1);
  else
    return -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    int a[n];
    int f = 0;
    long long int i;
    long long int x = 0;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] % 2 == 0)
        cout << a[i] / 2;
      else {
        if (a[i] < 0) {
          cout << (a[i] / 2) - f;
          f = (f + 1) % 2;
        } else {
          cout << (a[i] / 2) + x;
          x = (x + 1) % 2;
        }
      }
      cout << endl;
    }
  }
}
