시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 23 | 4 | 4 | 20.000% |
Charlie is a skilful Internet surfer and he can prove it by many e-mail addresses he uses regularly. Their use is password protected and he, not having good memory, had to think of a simple method of making and remembering them. A passwords Charlie use for his e-mail protection consist of two names of girls he secretly adores strung together.
He secretly adores at least two and at most five girls, they all have different names, and their names consist of at least three and at most eight letters. Lucy knows how Charlie constructs his e-mail passwords, somehow found them all and is eager to find the names of girls Charlie secretly adores. Write a program that will help Lucy to find the minimal set of names Charlie used to make his e-mail passwords.
The first line of input contains an integer N, a number of passwords (1 ≤ N ≤ 100).
The next N lines of the input contain passwords. A password is a sequence of at most 16 characters 'a'- 'z'.
The first line of output should contain number S, the minimal number of names the passwords are made of.
The names should be contained in the next S lines of the output, sorted in ascending order.
Note: Input data will be chosen so that the solution will be unique.
2 ivaana anaiva
2 ana iva
3 ananana nanahana hanaana
3 ana hana nana
3 nemikirk daglaskirk kirkdaglas
3 daglas kirk nemi