eolymp
bolt
Try our new interface for solving problems
Problems

Minimums to the left

Minimums to the left

Time limit 1 second
Memory limit 128 MiB

Given array of n integers. Move all minimum elements to the beginning of the array without changing the order of others.

Input data

The first line contains positive integer n (n100). Next line contains n integers. All numbers do not exceed 100 by absolute value.

Output data

Print the elements of updated array.

prb8963.gif

Examples

Input example #1
7
6 -3 -7 4 -7 -4 5
Output example #1
-7 -7 6 -3 4 -4 5
Author Matviychuk Sergiy Volodymyrovych
Source "ABC programming"