#K38317. Error Summary Generator

    ID: 26172 Type: Default 1000ms 256MiB

Error Summary Generator

Error Summary Generator

You are given a sequence of error messages. Your task is to generate a summary by counting the occurrences of each unique error message, preserving the order in which they first appear in the input. Note that error messages are case-sensitive and whitespaces are significant. For each unique error message, output the message followed by its count.

The problem can be summarized as follows: Given an integer $n$ and a list of $n$ error messages, for each distinct error message (in order of first occurrence), output the error message and the number of times it appears.

inputFormat

The input is read from stdin and has the following format:

  1. The first line contains an integer $n$ indicating the total number of error messages.
  2. The following $n$ lines each contain one error message.

outputFormat

Output the summary to stdout where each line contains a unique error message followed by a space and its occurrence count. The messages must be output in the order of their first appearance in the input.

## sample
6
File not found
Access denied
File not found
Server is down
File not found
Access denied
File not found 3

Access denied 2 Server is down 1

</p>