c1 = str ('мама')
c2 = str ('папа')
c3 = str ('дед')
c4 = str ('баба')
c5 = str ('брат')
magic = str (c1 + " " + c1 + " " + c1 + " " + c1 + " " + c1)
itertools.product(*[words] * len(words))
def r(w=words, n=5):
if n > 1:
yield from ([i] + rr for i in w for rr in r(w=w, n=n-1))
else:
yield from ([i] for i in w)