for combinations_permutation in permutations(all_combinations):
    groups = [combinations_permutation[group_length * i:group_length * (i +
        1)] for i in range(r)]
transpose = zip(*groups)
canonical = frozenset(map(frozenset, transpose))
if canonical not in found and all(len(col) == len(set(col)) for col in (sum
    (column, ()) for column in transpose)):
    found.add(canonical)
for group in groups:
    print(', '.join(map(''.join, group)))
print('----')
Группировка всех возможных комбинаций точек, взятых m одновременно, в r групп.