n, m = 6, 3
import itertools; import operator; print '\n'.join(sorted('{}={}'.format(reduced, '*'.join(map(str,fangs))) for fangs, reduced in ((fangs, reduce(operator.mul, fangs)) for fangs in itertools.combinations_with_replacement(range(10**(n/m-1), 10**(n/m)), m)) if sorted(str(reduced)) == sorted(''.join(map(str, fangs)))))
biwgbSA9IDYsIDMKaW1wb3J0IGl0ZXJ0b29sczsgaW1wb3J0IG9wZXJhdG9yOyBwcmludCAnXG4nLmpvaW4oc29ydGVkKCd7fT17fScuZm9ybWF0KHJlZHVjZWQsICcqJy5qb2luKG1hcChzdHIsZmFuZ3MpKSkgZm9yIGZhbmdzLCByZWR1Y2VkIGluICgoZmFuZ3MsIHJlZHVjZShvcGVyYXRvci5tdWwsIGZhbmdzKSkgZm9yIGZhbmdzIGluIGl0ZXJ0b29scy5jb21iaW5hdGlvbnNfd2l0aF9yZXBsYWNlbWVudChyYW5nZSgxMCoqKG4vbS0xKSwgMTAqKihuL20pKSwgbSkpIGlmIHNvcnRlZChzdHIocmVkdWNlZCkpID09IHNvcnRlZCgnJy5qb2luKG1hcChzdHIsIGZhbmdzKSkpKSk=