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


In this problem you should read from the standard input using functions such as input() and you should write to the standard output using functions such as print()

[IP106] Cypher's Betrayal

"Cypher, you've made the right decision. Your desire to return to the Matrix... to a world free from the suffering of reality... is understandable. All we need is for you to sabotage their mission. The rest will fall into place."

"You’re right, Smith.", Cypher says. "This glitch will be perfect."

Cypher pulls out a device from his pocket: a small chip that he's planted inside the Nebuchadnezzar.

"This little friend is doing to create errors in their code", Cypher grins.

"I see.", Smith nods. "So, you’re hoping to confuse them, halt their progress. A simple trick, really. But it will buy us time. I will make sure the agents are in position to capture them while they are occupied with this... glitch."

Cypher nods, a smug look crossing his face. He’s convinced that this simple flaw will be enough to bring down the crew. But little does he know, Neo is catching these glitches...

The Problem

Cypher has done his part. The glitch is in place. Now, it's up to you to help Neo find the errors in the code!

Write a program that reads a bunch of Python expressions and finds what expressions contain errors, how many times each error type appears, and prints a list of the types of errors that appear, sorted in decreasing order of frequency (and in case of a tie in increasing order of name).

You should use the eval() function to evaluate Python expressions (and you already know how to extract an error type and its name, right?)

Input

The first line of input contains an integer N, the number of Python expressions to evaluate. The following N lines each contain an expression.

Output

The output should contain as many lines as error types, in the format FREQUENCY ERROR_TYPE. The errors should come in decreasing order of frequency and in case of a tie in increasing alphabeteical order of the error type name.

Constraints

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

1 ≤ N ≤ 100       Number of lines to process

Example Input Example Output
16
1 / 0
1 % 0
1 + 2
[1, 2, 3]
2 + 3 + 4 +
[1, 2
3, 4]
AgentSmith
int("[]")
int("is this real life?")
{"a":2}["a"]
{"a":2}["b"]
[4,5,6][0]
[4,5,6][8]
open("smith.txt")
[0]*(2**100)
3 SyntaxError
2 ValueError
2 ZeroDivisionError
1 FileNotFoundError
1 IndexError
1 KeyError
1 NameError
1 OverflowError

Explanation of example input:


Introduction to Programming (CC1024)
DCC/FCUP - University of Porto