406072: GYM102254 E Essay Time

Memory Limit:1024 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Essay Timetime limit per test2.0 smemory limit per test1024 megabytesinputstandard inputoutputstandard output

Cadet Yu Yi Hakusho got caught, by Captain Leitor, leaning against the wall for the $$$4^{th}$$$ time. Furious, Captain Leitor ordered Yu Yi to write an essay about why he should not lean against the wall and, as he was not in a good mood, he also said that no word with four or more letters should be repeated.

Desperate, Yu Yi wrote many lines, trying not to repeat any word but, when he finished writing, he was not so sure about it so he wrote all words on his computer. As he doesn't know how to see which words are repeated, he asked you to help him.

Write a program that, given a list of words, tells which words Yi Yu should erase.

Input

The first line contains one integer, $$$n$$$ ($$$1 \le n \le 8 \times 10^6$$$) — the number of words that Yu Yi wrote.

The next $$$n$$$ lines contains, each, one string, $$$s_i$$$ — the words Yu Yi wrote.

The words contains only lowercase English letters. The sum of the length of all words is not greater than $$$8 \times 10^6$$$.

Output

In the first line print the number of repeated words.

In the next lines, print all repeated words in the same order they repeat, separated by spaces.

If there are no repeated words, print "SAFO" (without quotes).

ExamplesInput
6
not
clean
bad
posture
clean
enough
Output
1
clean
Input
8
not
clean
enough
bad
posture
clean
enough
enough
Output
3
clean
enough
enough

加入题单

算法标签: