#include<bits/stdc++.h>
using namespace std;
int main()
{
	int i,j,a,size,temp,num,count=0;
	cin >> size;
	vector<int> arr(size);
	for(i=0;i<size;i++)
		cin >> arr[i];
	for(i=0;i<size-1;i++)
	{
		if(arr[i+1] < arr[i])
		{
			temp = (arr[i] - arr[i+1]);
			arr[i+1] = a[i];
			count += temp;
		}
	}
	for(i=0;i<size;i++)
		cout << arr[i] << endl;
	//cout << count << endl;
	//return 0;
}