Given integers , , , and , find the smallest positive integer , greater than a \times c, which cannot be represented as the product of two natural numbers and such that a \leq u \leq b and c \leq v \leq d.
Positive integers , , , (1 \leq a \leq b \leq 10^6, 1 \leq c \leq d \leq 10^6) are given.
Print the required number .
Example 1
Example 2