#include using namespace std; int main() { int N; cin >> N; vector y( N ); for( int i = 0; i < N; i++ ) { cin >> y[i]; } long long sum = 0; for( int i = 0; i < N; i++ ) { sum += y[i]; } vector x( N ); for( int i = 0; i < N; i++ ) { x[i] = sum - y[i] * (N - 1); } for( int i = 0; i < N; i++ ) { if( i ) cout << " "; cout << x[i]; } cout << endl; }