N = gets.to_i y = gets.split(" ").map{|s| s.to_i} sum = y.sum puts y.map{|x| (sum - x * (N-1)).to_s}.join(" ")