line = eval(input())



a, b = [int(n) for n in line.split()]



apb = a+b



aa = a+(a-1)

bb = b+(b-1)



print((max(apb, max(bb, aa))))
a = [int(x) for x in input().split()]

a.sort()

maior = 0

maior += a[-1]

a[-1] -= 1

a.sort()

maior += a[-1]

print(maior)









line = eval(input())
a, b = [int(n) for n in line.split()]
apb = a + b
aa = a + (a - 1)
bb = b + (b - 1)
print((max(apb, max(bb, aa))))

a = [int(x) for x in input().split()]
a.sort()
maior = 0
maior += a[-1]
a[-1] -= 1
a.sort()
maior += a[-1]
print(maior)

-line = eval(input()) -a, b = [int(n) for n in line.split()] -apb = a + b -aa = a + (a - 1) -bb = b + (b - 1) -print((max(apb, max(bb, aa)))) +a = [int(x) for x in input().split()] +a.sort() +maior = 0 +maior += a[-1] +a[-1] -= 1 +a.sort() +maior += a[-1] +print(maior)