Logo
(追記) (追記ここまで)

3206번 - haker 다국어

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

문제

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

힌트

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2004 > Regional Competition - Juniors 3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /