use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| itr.next().unwrap().parse::().unwrap() * (n as i64 - 1)) .collect(); let sum = a.iter().sum::() / (n as i64 - 1); let mut out = Vec::new(); for i in 0..n { write!(out, "{}", sum - a[i]).ok(); if i != n - 1 { write!(out, " ").ok(); } } writeln!(out, "").ok(); stdout().write_all(&out).unwrap(); }