import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] line = br.readLine().split(" ", n); long[] arr = new long[n]; long total = 0; for (int i = 0; i < n; i++) { arr[i] = Integer.parseInt(line[i]); total += arr[i]; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { if (i != 0) { sb.append(" "); } long ans = total - arr[i] * (n - 1); sb.append(ans); } System.out.println(sb); } }