Rearrange an array so that all zeros move to the end while the relative order of the non-zero elements is preserved.
Input format
Line 1: an integer n.
Line 2: n space-separated integers (present whenever n >= 1).
Output format
One line: the n integers after moving zeros to the end, space-separated.
Constraints
- 1 <= n <= 100000
- -1000000000 <= each value <= 1000000000