The reversal F(n) of a positive integer n is the number you get by replacing every digit a of n with 9−a.
Zeros that end up in front of the leading significant digit are ignored. So the reversal of 9 is 0, the reversal of 91 is 8, the reversal of 124 is 875, and the reversal of 990 is 9.
The loveliness of n is n multiplied by F(n).

Given a positive integer N, find the largest loveliness among the numbers from 1 to N.