BasicLists & Dictionaries10 points

Which mail providers do our subscribers use?

The marketing team of an online bookshop wants to know which email providers dominate its newsletter list, so it can test how the newsletter looks in the most common inboxes first.

Addresses were typed by hand, so they may have spaces around them and any mix of upper and lower case. The domain is everything after the @, written in lower case. Every line contains exactly one @.

Task: the first line is an integer N (1 to 200). The next N lines each hold one email address. Print one line per distinct domain in the format domain count (a single space between them). Order the lines by count, highest first, and when counts are equal by domain name in alphabetical order.

Sample tests

Input

5
ali@gmail.com
SARA@Yahoo.com
  bob@gmail.COM 
noor@outlook.com
zed@yahoo.com

Expected output

gmail.com 2
yahoo.com 2
outlook.com 1

Input

3
x@proton.me
y@mail.ru
z@proton.me

Expected output

proton.me 2
mail.ru 1

Your answer is also checked against 2 hidden tests.