#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long int T = 1, n, m;
  string str;
  while (T--) {
    long long int p = 0, q = 0, tmp = 0, sum = 0, count = 0;
    int flag = 0;
    cin >> n;
    vector<pair<int, int> > v;
    for (long long int i = 0; i < n; ++i) {
      cin >> tmp;
      v.emplace_back(make_pair(tmp, tmp / 2));
    }
    long long int balance = 0;
    for (long long int i = 0; i < n; ++i) {
      balance += v[i].second;
    }
    if (balance < 0) {
      for (long long int i = 0; i < n; ++i) {
        if (balance == 0) break;
        if (v[i].first > 0 && v[i].first % 2 == 1) {
          v[i].second += 1;
          balance++;
        }
      }
    }
    if (balance > 0) {
      for (long long int i = 0; i < n; ++i) {
        if (balance == 0) break;
        if (v[i].first < 0 && v[i].first % 2 == -1) {
          v[i].second -= 1;
          balance--;
        }
      }
    }
    for (long long int i = 0; i < n; ++i) {
      cout << v[i].second << "\n";
    }
  }
  return 0;
}
