A,B,C,D = list(map(int,input().split()))

print((max(min(B,D)-max(A,C),0)))
A,B,C,D = list(map(int,input().split()))

print((max(0,min(B,D)-max(A,C))))
A, B, C, D = list(map(int, input().split()))
print((max(min(B, D) - max(A, C), 0)))

A, B, C, D = list(map(int, input().split()))
print((max(0, min(B, D) - max(A, C))))

-print((max(min(B, D) - max(A, C), 0))) +print((max(0, min(B, D) - max(A, C))))