http://codeforces.com/contest/1237/problem/A
#include <bits/stdc++.h>
//#include <cmath>
//#include <iostream>
//#include <unordered_map>
#define mem(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define INF 0x3f3f3f3f
#define ll long long
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int mod=1e9+7;
const int N=1e5+9;
int a[N],b[N];
int main()
{
FAST_IO;
int n;
cin>>n;
int sum=0;
for(int i=0;i<n;i++) cin>>a[i],sum+=a[i];
for(int i=0;i<n;i++)
{
if(a[i]%2==0)
{
b[i]=a[i]/2;
}
else
{
if(a[i]<0)
{
if(sum<0)
{
sum++;
b[i]=a[i]/2;
}
else if(sum>0)
{
b[i]=a[i]/2-1;
sum--;
}
else
{
b[i]=a[i]/2;
sum++;
}
}
else
{
if(sum<0)
{
b[i]=a[i]/2+1;
sum++;
}
else if(sum>0)
{
b[i]=a[i]/2;
sum--;
}
else
{
b[i]=a[i]/2;
sum--;
}
}
}
}
for(int i=0;i<n;i++) cout<<b[i]<<endl;
return 0;
}