Majka was exploring multi-digit numbers in which odd and even digits alternate regularly. She called those starting with an odd digit "funny" and those starting with an even digit "cheerful." (For example, the number 32387 is funny, and the number 4529 is cheerful.)

Majka created one three-digit funny number and one three-digit cheerful number, using six different digits, none of which were 0. The sum of these two numbers was 1617. The product of these two numbers ended with the two-digit number 40.

Determine Majka's numbers and calculate their product.

(M. Dillingerová)

Hint. How many digits can the products of three-digit numbers have, and how would you calculate them by hand?