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

문제

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.

예제 입력 1

2
ivaana
anaiva

예제 출력 1

2
ana
iva

예제 입력 2

3
ananana
nanahana
hanaana

예제 출력 2

3
ana
hana
nana

예제 입력 3

3
nemikirk
daglaskirk
kirkdaglas

예제 출력 3

3
daglas
kirk
nemi