fun main(args: Array<String>) {
    val width = readLine()!!.trim().toInt()

    val row1 = readLine()!!.trim().split(' ').map {it.toInt()}
    val row2 = readLine()!!.trim().split(' ').map {it.toInt()}

    val row1Ruisekiwa = Array<Int>(width + 1) {0}
    val row2Ruisekiwa = Array<Int>(width + 1) {0}

    (0..(width - 1)).forEach { x ->
        row1Ruisekiwa[x + 1] = row1Ruisekiwa[x] + row1[x]
        row2Ruisekiwa[x + 1] = row2Ruisekiwa[x] + row2[x]
    }

    var maxTotal: Int = 0

    (1..width).forEach { row1Right ->
        val row1Total = row1Ruisekiwa[row1Right]
        val row2Total = row2Ruisekiwa[width] - row2Ruisekiwa[row1Right - 1]

        val total = row1Total + row2Total
        if (maxTotal < total) {
            maxTotal = total
        }
    }

    println(maxTotal)
}
