Problem Description

Read n integers. Move all zeros to end keeping order of non-zeros. Output result.

Input Format

First line n. Second line n integers.

Output Format

One line result.

Sample Test Case

Input:
7 0 1 0 3 12 0 5
Output:
1 3 12 5 0 0 0

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next