TypeError: unsupported operand type(s) for -: 'str' and 'int'

Right now my code will create a text file including the positions of each word in a sentence in a list, and each word in a list - like so: http://i.imgur.com/AY0gqcG.png?1

My code then opens back up the file and should be able to recreate the sentence using those positions and the words in the text file, but it doesn't seem to work with with the readlines code for some reason.