a = list(map(int,input().split()))

evil = 0

odd = 0

ans = 0

for i in a:

    if i%2==0:

        evil += 1

    else:

        odd += 1

if evil==3 or odd==3:

    a = [max(a)-i for i in a]

    ans += sum(a)//2

else:

    if evil==2:

        ans += 1

        for i in range(3):

            if a[i]%2==0:

                a[i] += 1

    else:

        ans += 1

        for i in range(3):

            if a[i]%2==1:

                a[i] += 1

    a = [max(a)-i for i in a]

    ans += sum(a)//2

print(ans)

a = [int(i) for i in input().split()]

g = 0

k = 0

count = 0

for i in a:

    if i%2==0:

        g += 1

    else:

        k += 1

if g==1:

    count += 1

    for i in range(3):

        if a[i]%2==1:

            a[i] += 1

            

            

elif k==1:

    count += 1

    for i in range(3):

        if a[i]%2==0:

            a[i] += 1

a = sorted(a)[::-1]

count += (a[0]-a[1])//2 + (a[0]-a[2])//2

print(count)
a = list(map(int, input().split()))
evil = 0
odd = 0
ans = 0
for i in a:
    if i % 2 == 0:
        evil += 1
    else:
        odd += 1
if evil == 3 or odd == 3:
    a = [max(a) - i for i in a]
    ans += sum(a) // 2
else:
    if evil == 2:
        ans += 1
        for i in range(3):
            if a[i] % 2 == 0:
                a[i] += 1
    else:
        ans += 1
        for i in range(3):
            if a[i] % 2 == 1:
                a[i] += 1
    a = [max(a) - i for i in a]
    ans += sum(a) // 2
print(ans)

a = [int(i) for i in input().split()]
g = 0
k = 0
count = 0
for i in a:
    if i % 2 == 0:
        g += 1
    else:
        k += 1
if g == 1:
    count += 1
    for i in range(3):
        if a[i] % 2 == 1:
            a[i] += 1
elif k == 1:
    count += 1
    for i in range(3):
        if a[i] % 2 == 0:
            a[i] += 1
a = sorted(a)[::-1]
count += (a[0] - a[1]) // 2 + (a[0] - a[2]) // 2
print(count)

-a = list(map(int, input().split())) -evil = 0 -odd = 0 -ans = 0 +a = [int(i) for i in input().split()] +g = 0 +k = 0 +count = 0 -        evil += 1 +        g += 1 -        odd += 1 -if evil == 3 or odd == 3: -    a = [max(a) - i for i in a] -    ans += sum(a) // 2 -else: -    if evil == 2: -        ans += 1 -        for i in range(3): -            if a[i] % 2 == 0: -                a[i] += 1 -    else: -        ans += 1 -        for i in range(3): -            if a[i] % 2 == 1: -                a[i] += 1 -    a = [max(a) - i for i in a] -    ans += sum(a) // 2 -print(ans) +        k += 1 +if g == 1: +    count += 1 +    for i in range(3): +        if a[i] % 2 == 1: +            a[i] += 1 +elif k == 1: +    count += 1 +    for i in range(3): +        if a[i] % 2 == 0: +            a[i] += 1 +a = sorted(a)[::-1] +count += (a[0] - a[1]) // 2 + (a[0] - a[2]) // 2 +print(count)