def flatten_combinations(result_tree, current_combo=None, all_combos=None):
    if current_combo is None:
        current_combo = []
if all_combos is None:
    all_combos = []
if result_tree is None:
    all_combos.append(current_combo)
return
for word in result_tree:
    new_current_combo = current_combo[:]
new_current_combo.append({'word': word['word']})
Найти все пути через дерево (вложенные словари) сверху вниз