4340 - 두명의 하이스코어

Time Limit: 1s Memory Limit: 128MB

Submissions: 1328 Solved: 534
Description

N명의 학생의 이름과 성적을 입력으로 받아, 1등과 2등을 한 학생의 이름과 성적을 출력하는 프로그램을 작성하세요. 

Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score and the student with the second-highest score.

Input

* Line 1 : 학생수 N (2~10)

* Line 2 ~ N+1 : 이름 점수

 - 이름은 길이가 100을 넘지 않고 공백이 포함되지 않은 문자열임

 - 점수는 0~100 까지의 정수임 (동일한 점수는 존재하지 않음)

Output

* Line 1 : 1등을한 학생의 이름과 점수

* Line 2 : 2등을한 학생의 이름과 점수

Sample Input
5
Anna 80
June 75
Brave 35
Geek 95
April 99
Sample Output
April 99
Geek 95
Source

JAVA2015 PE5.9