#include <bits/stdc++.h>
using namespace std;
const long long OO = 2e18;
const double pi = 2 * acos(0.0);
bool isprime(long long int a) {
  if (a == 1) {
    return false;
  }
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> b(n);
  bool flag = false;
  for (i = 0; i < n; i++) {
    if (a[i] % 2 == 0) {
      b[i] = a[i] / 2;
    } else {
      if (flag == false) {
        if (a[i] >= 0) {
          b[i] = (a[i] / 2);
        } else {
          b[i] = (a[i] / 2) - 1;
        }
        flag = true;
      } else {
        if (a[i] >= 0) {
          b[i] = (a[i] / 2) + 1;
        } else {
          b[i] = (a[i] / 2);
        }
        flag = false;
      }
    }
  }
  for (i = 0; i < n; i++) {
    cout << b[i] << endl;
  }
}
