use std::io::{Read, Write}; fn run() { let out = std::io::stdout(); let mut out = std::io::BufWriter::new(out.lock()); let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let mut it = s.trim().split_whitespace(); let n: usize = it.next().unwrap().parse().unwrap(); let x: Vec = (0..n).map(|_| it.next().unwrap().parse().unwrap()).collect(); let y: Vec = (0..n).map(|_| it.next().unwrap().parse().unwrap()).collect(); let len: u32 = (0..n).map(|i| x[i] + y[i]).min().unwrap(); writeln!(out, "{}", len).ok(); writeln!(out, "0").ok(); for i in 0..n { writeln!(out, "{}", std::cmp::min(x[i], len)).ok(); } writeln!(out, "{}", len).ok(); } fn main() { run(); }