fun main(args: Array) { println(getAns()) } fun getAns():Long { val n = readLine()!!.toInt() val a = readLine()!!.split(" ").map { it.toLong() } val b = readLine()!!.split(" ").map { it.toLong() } val x = readLine()!!.split(" ").map { it.toLong() } val y = readLine()!!.split(" ").map { it.toLong() } var ans = 0L for(i in 0 until n) { var total = a[i*2] + a[i*2+1] + x[i] total = Math.max(total, a[i*2]+b[i*2+1]+y[i]) total = Math.max(total, b[i*2]+a[i*2+1]+y[i]) total = Math.max(total, b[i*2]+b[i*2+1]+x[i]) ans += total } return ans }