#include<iostream>
#include<vector>
using namespace std;
void solveMethod(vector<int> rands)
{
for(int i = 0; i < rands.size(); i++)
{
int ran = rands[i];
bool find = false;
for(int j = i; j < rands.size(); j++)
{
int other = rands[j];
if(ran < other)
{
cout << (j - i)*(other - ran);
find = true;
break;
}
}
if(!find)
{
cout << ran;
}
cout << " ";
}
cout << endl;
}
int main()
{
int n;
cin >> n;
vector<int> rands(n);
for(int i = 0; i < n; i++)
{
cin >> rands[i];
}
solveMethod(rands);
return 0;
}