#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector a(n); ll sum = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i] * (n - 1); } sum /= (n - 1); for (int i = 0; i < n; ++i) { a[i] = sum - a[i] * (n - 1); cout << a[i] << " \n"[i + 1 == n]; } return 0; }