import java.util.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int total = 0; List li = new ArrayList(); for(int i = 0; i < n; i++){ int tmp = sc.nextInt(); li.add(tmp); total += tmp; } int i = 0; for(int v: li){ if(i == n-1){ System.out.print(total-v*(n-1)); }else{ System.out.print(total-v*(n-1)+" "); } i++; } } }