In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of December 7th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #08 exercise sheet]


[AED043] Movie Reviews

If you like cinema, you certainly know websites such as IMDB or Rotten Tomatoes. These websites contain a lot of information about movies, with particular emphasis on reviews made by users. In this problem, we want to be able to process reviews. Each review is given as a pair (movieName, score), with the scores being integers between 1 and 10.

The Problem

Given a collection of movie reviews, your task is to find out the following values:

Input

The first line of the input contains an integer N, the number of movie reviews.

The next lines each contain a movie review given as a pair Mi Si indicating the movie name (a string without spaces) and a score (an integer between 1 and 10).

Output

The output should consist of three lines:

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

1 ≤ N ≤ 105       Number of moview reviews
1 ≤ |Mi| ≤ 30       Length of each movie name
1 ≤ Si ≤ 10       Review score

Example Input Example Output
11
Dune2 10
DeadPoolandWolverine 8 
InsideOut2 6
JokerFolieADeux 4
JokerFolieADeux 6
Dune2 8
DeadPoolandWolverine 7
Dune2 4
InsideOut2 7
InsideOut2 8
Megalopolis 4
5
3 2
3

Explanation of Example Input:



Algorithms and Data Structures (L.EIC011) 2024/2025
DCC/FCUP & DEI/FEUP - University of Porto