import sys
sys.stdin = open("input.txt","rt")
a,b,c,d = list(map(int, input().split()))
kind_distance = (abs(a-c), abs(b-d),a,b)
print(min(kind_distance))
import sys
sys.stdin = open("input.txt","rt")
a,b,c,d = list(map(int, input().split()))
kind_distance = (abs(a-c), abs(b-d),a,b)
print(min(kind_distance))