from random import shuffle
def getsents(start, rest):
    if len(rest) == 1:
        return [start + rest[0]]
    else:
        currwords = []
        for word in xrange(len(rest)):
            currwords += [start + sent for sent in getsents(rest[word] + ' ', rest[:word] + rest[word + 1:])]
    return currwords
words = ['no','stop','dude','literally','like','seriously','fuck','pls']
sents = getsents('', words)
shuffle(sents)
#out = open("sentence_pls_list.txt", "w")
#out.write('\n'.join(sents))
#out.close()
print sents[0]
