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

ans=0

for i in range(2):

    ans += max(a,b)

    if a>b:

        a -=1

    else:

        b -=1

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

preans = max(a*2-1,b*2-1)

ans=max(preans,a+b)

print(ans)
a, b = list(map(int, input().split()))
ans = 0
for i in range(2):
    ans += max(a, b)
    if a > b:
        a -= 1
    else:
        b -= 1
print(ans)

a, b = list(map(int, input().split()))
preans = max(a * 2 - 1, b * 2 - 1)
ans = max(preans, a + b)
print(ans)

-ans = 0 -for i in range(2): -    ans += max(a, b) -    if a > b: -        a -= 1 -    else: -        b -= 1 +preans = max(a * 2 - 1, b * 2 - 1) +ans = max(preans, a + b)