CSCI-UA 102 (Data Structures)

Lab 12 How Many Words

This lab will give you some practice in submitting the types of problems you will be working on for project 5.

The implementation is up to you. You need to decide which data structures to use and how to approach the problem. Your solution can use any of the library classes you want to use.

The name for the class that contains main() function should be Main. There should NOT be any package names in the submitted files. The program should read all the input from the standard input stream, and write all the output to the standard output stream.

The submission link is available on Gradescope. You will see if you passed or failed tests. But you will NOT see what the tests are, so make sure to come up with tests on your own.

Problem Statement

In an introductory English class, Professor Umbridge assigns the students an impossible task of finding all the unique words in a ten-volume encyclopedia of magic. By her definition words are sequences of one or more consecutive alphabetic characters in upper or lower case. Their uniqueness should be determined in a case insensitive way, so words like "magic", "Magic", "MaGiC" should be treated as the same.

As an upperclassman in the school, you and your friends decide to help, by writing a program that will complete the task in a tiny fraction of the time and annoy Professor Umbridge.

Input

The input is a text with up to 5,000 lines. Each line has at most 200 characters. The input is terminated by EOF.

Output

A list of unique words that appear in the text, one per line. The output should be in alphabetical order and in lower case. You are guaranteed that the number of unique words in the text is no more than 5,000.



Example 1

Input:
Professor Umbridge, Room 3789, +44-7911 123456

Output:
professor
room
umbridge


Example 2

Input:
In an introductory English class taught by Professor Umbridge assigns the students
and impossible task for counting all the unique words in a ten-volume encyclopedia
of magic.
By her definition words are sequences of one or more consecutive alphabetic characters
in upper or lower case. Their uniqueness should be determined in a case insensitive way,
so  words like "magic", "Magic", "MaGiC" should be treated as the same.

Output:
a
all
alphabetic
an
and
are
as
assigns
be
by
case
characters
class
consecutive
counting
definition
determined
encyclopedia
english
for
her
impossible
in
insensitive
introductory
like
lower
magic
more
of
one
or
professor
same
sequences
should
so
students
task
taught
ten
the
their
treated
umbridge
unique
uniqueness
upper
volume
way
words