write relational words to output file