#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = (int)1e9 + 7;
const int N = (int)1e6 + 7;
const int M = (int)-1;
int main() {
  int n;
  cin >> n;
  int f = 0;
  for (int i = (0); i < (n); ++i) {
    int a;
    cin >> a;
    if (a & 1) {
      int t1 = a / 2, t2 = a - t1;
      if (t1 > t2) swap(t1, t2);
      if (f == 0) {
        cout << t1 << endl;
        f = -1;
      } else {
        cout << t2 << endl;
        f = 0;
      }
    } else
      cout << a / 2 << endl;
  }
}
