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

print((min(a+b+1, c)+b))
a,b,c = list(map(int, input().split()))

if a+b>=c-1:

	print((b+c))

else:

	print((a+b+1+b))

a, b, c = list(map(int, input().split()))
print((min(a + b + 1, c) + b))

a, b, c = list(map(int, input().split()))
if a + b >= c - 1:
    print((b + c))
else:
    print((a + b + 1 + b))

-print((min(a + b + 1, c) + b)) +if a + b >= c - 1: +    print((b + c)) +else: +    print((a + b + 1 + b))