# IdeaGen v0.1
# License: Public Domain

import itertools

def func(n):
    with open("wordslist.txt") as file:
        words = file.read().splitlines()

    with open('ideaslist.txt', 'a') as file:
        text = '\n'.join(map(' '.join, itertools.combinations(words, n)))
        file.write(text)
        file.write('\n')

func(2)
func(3)

with open('ideaslist.txt', 'a') as file:
    file.write('\n')