#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using D = double;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T>
T sqr(T a) {
  return a * a;
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T sgn(T a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
template <typename T>
T abs(T a) {
  return a > 0 ? a : -a;
}
const int inf = 2e9;
const ld st = 0.000001;
const ld pi = acos((ld)-1);
const int MAXN = 100000;
const int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  int x1 = 0, x2 = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x % 2 == 0) {
      cout << x / 2 << endl;
    } else {
      if (x < 0) {
        cout << (-1) * (abs(x) + x1) / 2 << endl;
        x1 ^= 1;
      } else {
        cout << (abs(x) + x2) / 2 << endl;
        x2 ^= 1;
      }
    }
  }
  return 0;
}
