s = []
for a in ('ТЬЮРИНГ'):
for b in ('ТЬЮРИНГ'):
for c in ('ТЬЮРИНГ'):
for d in ('ТЬЮРИНГ'):
for e in ('ТЬЮРИНГ'):
for f in ('ТЬЮРИНГ'):
w=a+b+c+d+e+f
if a != 'Ь' and w. count('ЮЬ') == 0 and w. count('ИЬ') == 0 and w. count('Т') <= 1 and w. count('Ь') <= 1 and w. count('Ю') <= 1 and w. count('Р') <= 1 and w. count('И') <= 1 and w. count('Н') <=1 and w. count('Г') <= 1:
s. append(w)
print(len(s))
Выведет:3120