#include <iostream>
int main() {
size_t i, n, c = 0;
std::cin >> n;
float m = 0, *v = new float[n];
for (i = 0; i < n; ++i) {
std::cin >> v[i];
if (v[i]) {
m += v[i];
++c;
}
}
m /= c;
for (i = 0; i < n; ++i) {
if (!v[i])
v[i] = m;
std::cout << v[i] << ' ';
}
delete[] v;
}