시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB124786863.551%

문제

In machine translation (MT) system, the length of sentences affects the performance of a MT system. The analysis of the length of sentences is one of factors to assess the difficulty of translation.

Ar-Ku+ Translation Company asks the contestants to analyze the set of sentences in English news. The information that needs to be extracted from the news is the length of the sentences and the frequency of each length. Words in a sentence are separated by a space (or spaces). We can assume that there are no other white spaces such as tab.

입력

The first line of the input contains an integer N (1 ≤ N ≤ 4,000) indicating the number of sentences. The following N lines are sentences, one sentence in each line. A sentence has between 2 to 75 words inclusive.

출력

Print out, in each line, the length of sentences that occurs in the input text and its frequency. The two values are separated by a space. The output must be sorted by the first value.

예제 입력 1

7
This is an example.
Do you really understand this problem?
Yes, I really do.
This sentence has 5 words.
It's not difficult, isn’t it?
X Y Z @ # % &  *  ! (    ) <*-*>
The end.

예제 출력 1

2 1
4 2
5 2
6 1
12 1