generates a markov chain of words based on input files