Problems

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

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

Given three integers **a**, **b** and **c**. Find the **n**-th term which is divisible by either of **a**, **b** or **c**.

#### Input

Four integers **a**, **b**, **c** and **n** (**a**, **b**, **c**, **n** ≤ `10`

).^{9}

#### Output

Print the **n**-th term divisible by either **a** or **b** or **c**. It is known that the answer is no more than `10`

.^{9}

Input example #1

2 3 5 10

Output example #1

14

Input example #2

3 5 7 10

Output example #2

18