1411 - Word Count

Time Limit: 2s Memory Limit: 128MB

Submissions: 415 Solved: 134
Description

Give you a list of N words, combine all the identicals, output the words and their appearence times lexicographically.
 

Input

Only one case.
First line is the number of words N(1<=N<=1000).
Next N lines, each has a word, only contain lower case letters. The length of each is less than 20.
 

Output

Order the word lexicographically, each unique word just output once.
For each word output in a line, the word, a blank, the appearence times of the word in the list.
 

Sample Input
6
ll
erbao
ahanhan
erbao
llswife
aha
Sample Output
aha 1
ahahan 1
erbao 2
ll 1
llswife 1
Hint
Source
Hong Zehua, HUST Campus 2010, Preliminary