n-th term divisible by a, b or c#461

n-th term divisible by a, b or c

1 second
128 megabytes
Medium (≈1350)

Given three integers and . Find the -th term which is divisible by either of or .

Input

Four integers a, b, c and n~(a, b, c, n \le 10^9).

Output

Print the -th term divisible by either or or . It is known that the answer is no more than 10^9.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 7

Loading
Loading