print("Exemple:")
noises = 125*17*29

gallions = 125
mornilles = gallions * 17
noises = mornilles * 29

digits_noises = "".join(sorted(list({key:None for key in str(noises)}.keys())))
digits_mornilles = "".join(sorted(list({key:None for key in str(mornilles)}.keys())))
digits_gallions = "".join(sorted(list({key:None for key in str(gallions)}.keys())))

print("noises", noises)
print("mornilles", mornilles)
print("gallions", gallions)


print("Maintenant, les choses sérieuses:")
gallions = 1

while True:
    mornilles = gallions * 17
    noises = mornilles * 29

    digits_noises = "".join(sorted(list({key:None for key in str(noises)}.keys())))
    digits_mornilles = "".join(sorted(list({key:None for key in str(mornilles)}.keys())))
    digits_gallions = "".join(sorted(list({key:None for key in str(gallions)}.keys())))

    if digits_noises == digits_mornilles and digits_noises == digits_gallions:
        print("noises", noises)
        print("mornilles", mornilles)
        print("gallions", gallions)
        break

    gallions = gallions + 1
