local n = io.read("*n") 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 min = x[1] + y[1] for i = 2, n do min = math.min(min, x[i] + y[i]) end print(min) print(0) for i = 1, n do print(math.min(x[i], min)) end print(min)