import java.io.BufferedReader; import java.io.InputStreamReader; 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[] sa = br.readLine().split(" "); int[] y = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { y[i] = Integer.parseInt(sa[i]); sum += y[i]; } br.close(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { int x = sum - y[i] * (n - 1); sb.append(x).append(' '); } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); } }