Number#2224

Number

1 second
128 megabytes
Easy

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.

Input

Positive integers , , , (1 \leq a \leq b \leq 10^6, 1 \leq c \leq d \leq 10^6) are given.

Output

Print the required number .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading