#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[10080];
  unsigned int sum = 0, num = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i] * (i - a[i + 1]);
    num += a[i] * (i - a[i + 1]) - num;
    cout << num << " ";
  }
  cout << sum - num + 16 << endl;
}
