fun main(array: Array<String>) {
    val n = readLine()!!.toInt()
    val one = readLine()!!.split(   " ").map { it.toInt() }
    val two = readLine()!!.split(" ").map { it.toInt() }
    var max = 0
    for(i in 0 until n) {
        for(j in i until n) {
            val temp1 = one.take(i + 1).sum()
            val temp2 = two.takeLast(n - i).sum()
            val temp = temp1 + temp2
            max = if(temp >= max) {
                temp
            }
            else {
                max
            }
        }
    }
    print(max)
}