local n = io.read("*n") local a, b = {}, {} for i = 1, 2 * n do a[i] = io.read("*n") end for i = 1, 2 * n do b[i] = io.read("*n") end local x, y = {}, {} for i = 1, n do x[i] = io.read("*n") end for i = 1, n do y[i] = io.read("*n") end local ans = 0 for i = 1, n do local p = 2 * i - 1 local q = 2 * i ans = ans + math.max( a[p] + a[q] + x[i], a[p] + b[q] + y[i], b[p] + a[q] + y[i], b[p] + b[q] + x[i] ) end ans = tostring(1LL * ans):gsub("LL", "") print(ans)