#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  vector<long long> v;
  bool neg_round = false;
  bool pos_round = false;
  long long x = 0;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a % 2 == 0) {
      a = a / 2;
    } else {
      if (a < 0) {
        if (neg_round) {
          a = (a - 1) / 2;
        } else {
          a = a / 2;
        }
        neg_round = !neg_round;
      } else {
        if (pos_round) {
          a = (a + 1) / 2;
        } else {
          a = a / 2;
        }
        pos_round = !pos_round;
      }
    }
    x += a;
    cout << a << '\n';
  }
  return 0;
}
