#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long k = 1;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] % 2 == 0) {
        cout << a[i] / 2 << '\n';
        continue;
      }
      if (a[i] < 0) {
        if (k & 1) {
          cout << a[i] / 2 << '\n';
          k++;
          continue;
        } else {
          cout << a[i] / 2 - 1 << '\n';
          k++;
          continue;
        }
      } else {
        if (k & 1) {
          cout << a[i] / 2 + 1 << '\n';
          k++;
          continue;
        } else {
          cout << a[i] / 2 << '\n';
          k++;
          continue;
        }
      }
    }
  }
}
