Загрузка данных


from itertools import*
cnt = 0
for x in product('аелпрь',repeat=6):
           s = ''.join(x)
           cnt +=1
           if cnt%2==1 and s[0]!='а' and s[0]!='л' and s.count('п')>=2:
                       print(cnt)
                       break