Under construction

Still being built. Things may change

Bronze Count

Interview

Time limit1sMemory limit1024 MB

Summary
Given N participant scores, find the third-highest distinct score and how many participants received that score.
Level

Easy2 of 10

Topics
Sorting, Implementation
Solved
No attempts yet

Problem

After a competition, you are curious how many participants were awarded bronze. Gold goes to every participant with the highest score. Silver goes to every participant with the second highest score. Bronze goes to every participant with the third highest score.

Given the list of all scores, find the score required for bronze and the number of participants who achieved that score.

Input

The first line contains a positive integer N, the number of participants. Each of the next N lines contains one participant's score, an integer from 0 to 75 inclusive. There are at least three distinct scores.

Output

Print a non-negative integer S and a positive integer P, separated by a single space. S is the score required for bronze, and P is the number of participants who achieved that score.

Examples2

  1. Example 1

    Input
    4
    70
    62
    58
    73
    
    Expected output
    62 1
    
  2. Example 2

    Input
    8
    75
    70
    60
    70
    70
    60
    75
    70
    
    Expected output
    60 2