DOMAINS | 프로그래밍의 벗 PivotOJ
PivotOJ

DOMAINS

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2001 Regional Competition - JuniorsBOJ 3277

문제

Dave likes to surf on Internet and visit many interesting web sites. He stores addresses of web pages he visited in a file.

Make a program that will help Dave to determine the most often visited domains. Also, the program should find how often Dave visited them.

입력

The first line of input file contains a natural number N, 1 ≤ N ≤ 100, the number of addresses.

Each of the following N lines contains one simplified address. A simplified address may begin with a prefix 'http://', after which comes one or more words separated with dot ('.'). That part of an address represents a name of a computer. After that may came a path consisting of character '/' followed by one or more words also separated with character '/'. Each word is a sequence of one or more small letters of English alphabet (a–z). Domain name is the last word in a name of a computer and consists of three characters at most.

Every address will consist of 50 characters at most.

출력

The first line of output file should contain the number of visits to the most often visited domain(s).

The second line should contain all the most often visited domains in any order. Every two domains should be separated by one space character.

예제

예제 1

입력
3
www.hr/www
com
http://abc.def.net
출력
1
com hr net

예제 2

입력
4
http://abc.def
http://abc.def.ghi
def.ghi/abc
http://bea.vis.but.thead.xyz
출력
2
ghi

예제 3

입력
5
com/put1/put2
http://def.exe
my.dad.exe/put
nesto.bat
http://my.mom.com
출력
2
exe com
코드를 제출하려면 로그인하세요.