a=gets.chomp.split(" ")
a.map!{|x| x.to_i}
suma=a.inject{|sum,n| sum + n}

b=gets.chomp.split(" ")
b.map!{|x| x.to_i}
sumb=b.inject{|sum,n| sum + n}

if suma >= sumb
	puts suma
elsif suma < sumb
	puts sumb
end
