402812: GYM100886 G Maximum Product

Memory Limit:0 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Maximum Producttime limit per test1 secondmemory limit per test256 mebibytesinputstandard inputoutputstandard output

Find the number from the range [a, b] which has the maximum product of the digits.

Input

The first line contains two positive integers a and b (1 ≤ a ≤ b ≤ 1018): the left and the right ends of the range.

Output

Print the number with the maximum product of the digits from the range [a, b]. If there are several possible answers, print any one of them.

ExamplesInput
1 10
Output
9
Input
51 62
Output
59

加入题单

上一题 下一题 算法标签: