# 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

# main program
# upload the dictionary
f = open("dictionary.txt", "r")
dictionary = []
for line in f:
    dictionary.append(line.rstrip())
f.close()

# Read the input text 
punctuationMarks = map(chr, range(0, ord("A")) + range(ord("Z")+1, ord("a")) + range(ord("z")+1, 127))
f = open("input.txt")	
bigString = f.read()	# read the entire text file in one go
f.close()

# Now filter out puncuation marks and split into words
bigString = filterOutPunctuation(punctuationMarks, bigString)	
L = bigString.split()

# For each word in the list of words L, look for the word in the dictionary
# and print it out if it is not in the dictionary
for word in L:
	if word.lower() not in dictionary:
		print word