import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') x1,y1 = map(int,input().split()) x2,y2 = map(int,input().split()) a = abs(y2-y1)/(x2+x1) if y2 == y1: print(y1) exit() if y1 < y2: y = a*(-x2)+y2 else: y = a*(-x1)+y1 print(y)