#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (int i = 0; i < N; i++) {
    int b;
    std::cin >> b;
    a.push_back(b);
  }
  std::vector<int> c;
  std::vector<int> d;
  d.push_back(a[0]);
  for (int j = 1; j < N; j++) {
    if (a[j - 1] <= a[j]) {
      c.push_back(0);
      d.push_back(a[j]);
    } else if (a[j - 1] > a[j]) {
      c.push_back(std::abs(a[j] - d[j - 1]));
      d.push_back(a[j] + std::abs(a[j] - d[j - 1]));
    }
    int k;
    int sum = 0;
    for (k = 0; k < N; k++) {
      sum = sum + c[k];
    }
    std::cout << sum << std::endl;
  }
}
