import java.lang.Math.*

fun main(args: Array<String>?): Unit {
    while(true) {
        val m = readLine()!!.trim().toInt()
        if (m == 0) break
        val first = IntArray(m - 1){ readLine()!!.trim().toInt()}
        val second = IntArray(readLine()!!.trim().toInt() - 1){readLine()!!.trim().toInt()}
        val firstArea = first.sumByDouble { sin(it.toRad()) } + sin((360 - first.sum()).toRad())
        val secondArea = second.sumByDouble { sin(it.toRad()) } + sin((360 - second.sum()).toRad())
        if (abs(firstArea - secondArea) < 1e-9) {
            println(0)
        }else if (firstArea > secondArea) {
            println(1)
        }else {
            println(2)
        }
    }
}
fun Int.toRad(): Double {
    return PI * this / 180
}
