import strutils,sequtils var A,B,N,M: int64 (A,B,N,M)=stdin.readLine.split.map(parseInt) if A>B: echo B+(A-B)div(N+1) else: echo A+(B-A)div(M+1)