CF803B Distances to Zero

Description

You are given the array of integer numbers $ a_{0},a_{1},...,a_{n-1} $ . For each element find the distance to the nearest zero (to the element which equals to zero). There is at least one zero element in the given array.

Input Format

The first line contains integer $ n $ ( $ 1

Output Format

Print the sequence $ d_{0},d_{1},...,d_{n-1} $ , where $ d_{i} $ is the difference of indices between $ i $ and nearest $ j $ such that $ a_{j}=0 $ . It is possible that $ i=j $ .