Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/array/zeroing-between-minimum-and-maximum

Zeroing between minimum and maximum

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 128 MB 32%
Share

A positive integer and an array of distinct integers are given. Replace with all elements located between the smallest and the largest elements (the smallest and the largest elements themselves do not change) and print the array.

Zeroing the range between the minimum and the maximum

Input

The first line contains a positive integer . The second line contains distinct integers separated by spaces.

Output

One line with integers separated by spaces.

Note


Examples

Input #1
7
12 3 8 14 5 20 7
Output #1
12 3 0 0 0 20 7
Input #2
4
10 1 5 2
Output #2
10 1 5 2

Sign in to submit a solution

Signing up is free and takes a minute.