Not able to get the logic

We have three integers A, B, C. A special set contains the number that are multiples of any of three integers in a sorted manner. A kth number is available, our task is to compute the kth number.
Input Format : A,B,C,k

Example
Input : 1 2 3 4(kth number=4 )
Output : 4

Input : 2 4 5 5(kth number=5)
output : 8