Problem Description

For every window size from 1 to n, print the maximum among all minimums of windows of that size.

Input Format

One line: n then n integers.

Output Format

One line: n integers.

Sample Test Case

Input:
7 10 20 30 50 10 70 30
Output:
70 30 20 10 10 10 10

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next