#include <bits/stdc++.h>

#define Mod 998244353

using namespace std;



typedef long long ll;
 
 
inline int read() {
	int out = 0;
	bool flag = false;
	register char cc = getchar();
	while (cc < '0' || cc > '9') {
		if (cc == '-') flag = true;
		cc = getchar(); 
	}
	while (cc >= '0' && cc <= '9') {
		out = (out << 3) + (out << 1) + (cc ^ 48);
		cc = getchar();
	}
	return flag ? -out : out;
}
 
inline void write(ll x, char ch) {
	if (x < 0) putchar('-'), x = -x;
	if (x == 0) putchar('0');
	else {
		int num = 0;
		char cc[22];
		while (x) cc[++num] = x % 10 + 48, x /= 10;
		while (num) putchar(cc[num--]);
	}
	putchar(ch);
}

int fpow(int x, int y) {
	int res = 1;
	while (y) {
		if (y & 1) res = 1ll * res * x % Mod;
		x = 1ll * x * x % Mod;
		y >>= 1;
	}
	return res;
}

const int N = 2e5 + 10;

int n, a[N];

long long pre, Max, ans;

int main() {
	n = read();
	for (int i = 1; i <= n; i++) a[i] = read();
	for (int i = 1; i <= n; i++) {
		pre += a[i];
		long long las = Max; Max = max(Max, (ll)a[i]);
		ans += pre, ans = ans - las * (i - 1ll) + Max * i;
		write(ans, '\n'); 
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define fo(i,a,n) for(i=a;i<n;i++)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define sortrev(x) sort(all(x),greater<int>())
#define pi 3.1415926535897932384626
 
typedef pair<int,int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll>  vl;
typedef vector<pii> vpii;
typedef vector<pl>  vpl;
typedef vector<vi>  vvi;
typedef vector<vl>  vvl;
typedef vector<double> vd;
 
const int mod = 1000000007;
const int inf = 1000000000;
const int N = 100007, M = N;
ll i,j,cnt,par;
 
void solve() {
	int n;
	cin>>n;
	cout<<(100 - n%100) <<"\n";
}



int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    int t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }

    return 0;
}

