a, b, c, d = list(map(int, input().split()))

e = max(a, c)

f = min(b, d)

print((f - e if f - e >= 0 else 0))

l = [0] * (100 + 1)

a, b, c, d = list(map(int, input().split()))

l[a] += 1

l[b] += -1

l[c] += 1

l[d] += -1

cnt = 0

t = 0

for i in range(101):

    t += l[i]

    if t == 2:

        cnt += 1

print(cnt)

a, b, c, d = list(map(int, input().split()))
e = max(a, c)
f = min(b, d)
print((f - e if f - e >= 0 else 0))

l = [0] * (100 + 1)
a, b, c, d = list(map(int, input().split()))
l[a] += 1
l[b] += -1
l[c] += 1
l[d] += -1
cnt = 0
t = 0
for i in range(101):
    t += l[i]
    if t == 2:
        cnt += 1
print(cnt)

+l = [0] * (100 + 1) -e = max(a, c) -f = min(b, d) -print((f - e if f - e >= 0 else 0)) +l[a] += 1 +l[b] += -1 +l[c] += 1 +l[d] += -1 +cnt = 0 +t = 0 +for i in range(101): +    t += l[i] +    if t == 2: +        cnt += 1 +print(cnt)