The Seven Warlords

Time limit10sMemory limit256 MB

Summary
Given up to ten million student grades, output the seven lowest grades in increasing order, one per line. Ties on the cut line still yield exactly seven grades.
Level

Medium4 of 10

Topics
Sorting, Heap, Array, Implementation
Solved
No attempts yet

Problem

Joe is a professor who teaches a logic circuit design course. At the start of the term he promised a good grade to every student except seven.

Given the final grade of every student, find the grades of the seven students with the lowest grades. Joe takes those seven to his lab, You See Lab, and calls them the Seven Warlords.

Input

The first line contains the number of students 8≤N≤10,000,0008 \le N \le 10{,}000{,}000.

Each of the next NN lines contains the grade of one student, in arbitrary order. A grade is at least 0 points and at most 100 points, is awarded in steps of 0.001 points, and is written with exactly three digits after the decimal point.

Output

Print the grades of the seven students with the lowest grades, one per line, in increasing order. Print each grade with three digits after the decimal point, the same way the input gives it. If students tie on the cut line, still print exactly seven grades.

Examples1

  1. Example 1

    Input
    8
    20.000
    70.000
    50.000
    30.000
    70.000
    30.000
    60.000
    70.000
    
    Expected output
    20.000
    30.000
    30.000
    50.000
    60.000
    70.000
    70.000