#include <iostream>
using namespace std;
int main()
{
int v[100], n,i ,k=0,s=0, aux;
cout<<"n=";
cin>>n;
for(i=0;i<n;i++)
cin>>v[i];
for(i=0;i<n;i++)
{
if(v[i])
{
s+=v[i];
k++;
}
}
aux= s/k;
for(i=0;i<n;i++)
{
if(v[i]==0)
{
v[i]=aux;
}
}
for(i=0;i<n;i++)
cout<<v[i]<<" ";
return 0;
}