#include <bits/stdc++.h>
using namespace std;
void print1D(vector<long long> a) {
  for (long long i = 0; i < a.size(); ++i) {
    cout << a[i] << " ";
  }
  cout << endl;
}
void print2D(vector<vector<long long> > a) {
  for (long long i = 0; i < a.size(); ++i) {
    for (long long j = 0; j < a[i].size(); ++j) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  double k = 0;
  long long ans;
  for (long long i = 0; i < n; ++i) {
    if (a[i] % 2 == 0) {
      cout << a[i] / 2 << endl;
    } else {
      if (a[i] > 0) {
        k += 0.5;
      } else {
        k -= 0.5;
      }
      ans = a[i] / 2 + k;
      if (k == -1 || k == 1) k = 0;
      cout << ans << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
