#include using namespace std; int main() { int N; cin >> N; vector Y(N); for (int i = 0; i < N; i++) cin >> Y.at(i); long sum = 0; for (auto y : Y) sum += y * (N - 1); sum /= (N - 1); for (int i = 0; i < N; i++) cout << sum - Y.at(i) * (N - 1) << ((i == N - 1) ? "\n" : " "); }