Program to get distinct word list from the given file