Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Prepared by Ibrahim Mesecan.
12th Grade Elective Subjects
Shqip
Question:
Maturity exams for 12th grade students are organized by the
ministry every year. The students are able to choose 3 subjects
out of 20. Write a program that reads 3 choices
of n students. And then, the program counts and shows
course list with the number of students who has chosen
that course.
Input specification
You will be first given the number of students
an integer number (n) where 2 ≤ n ≤ 10,000.
Then, in the following n lines, you will be given
three course names where course names are one word
strings containing only uppercase or lowercase
English letters (no special characters).
Output specification
Show course list in ascending lexicographic order
followed by the number of students taking that exam.
Sample Input
4
Biology Geography Sociology
French Geography Psychology
English History Physics
French History Sociology
|
Sample Output
Biology 1
English 1
French 2
Geography 2
History 2
Physics 1
Psychology 1
Sociology 2
|
Для отправки решений необходимо выполнить вход.
|