x,y=map(int,raw_input().split()) x2,y2=map(int,raw_input().split()) ans=max(x,y) if x==0 and x2==0 and y2