# Takes a line s and replaces all punctuation marks given # in the list punctuationMarkes by blanks; returns the modified list def filterOutPunctuation(punctuationMarks, s): for mark in punctuationMarks: s = s.replace(mark, " ") return s # Returns the list obtained by deleting all duplicates # from L def removeDuplicates(L): newL = [] for word in L: if word not in newL: newL = newL + [word] return newL #Main program print "Enter some text" s = raw_input().lower() L = [] punctuationMarks = [",", ".", ":", ";", "!", "/", "?", '"'] while s: s = filterOutPunctuation(punctuationMarks, s) L = L + s.split() s = raw_input().lower() print sorted(removeDuplicates(L))