#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int sum = 0;
  for (int i = 0; i < N; i++) {
    sum += A.at(i);
  }
  int mean = sum / N;
  for (int i = 0; i < N; i++) {
    if (A.at(i) > mean) {
      A.at(i) - mean;
      int x = A.at(i) - mean;
      if (A.at(i - 1) - mean < x) {
        x = A.at(i - 1);
        cout << x << endl;
      } else {
        mean - A.at(i);
        int x = mean - A.at(i);
        if (mean - A.at(i - 1) < x) {
          x = A.at(i - 1);
          cout << x << endl;
        }
      }
    }
  }
}
