#include <bits/stdc++.h>
using namespace std;
int a[8005], n;
int Solve(int pos)
{
// c[i]表示區間[i,pos-1](i<pos)或區間[pos+1,i](i>pos)中,
// 比a[pos]大的數的個數減去比a[pos]的數小的個數
int c[8005];
c[pos] = 0;
for(int i = pos-1; i >= 0; i--)
{
if(a[i] > a[pos])
c[i] = c[i+1] + 1;
else
c[i] = c[i+1] - 1;
}
for(int i = pos+1; i < n; i++)
{
if(a[i] > a[pos])
c[i] = c[i-1] + 1;
else
c[i] = c[i-1] - 1;
}
// count用於統計在pos左邊的c的分佈
// 由於存在負數,故需要加9000偏移量
// 例如說,-1就會記在-1+9000=8999這個位置上
int cnt[18005];
memset(cnt, 0, sizeof(cnt));
int ret = 0;
for(int i = 0; i < pos; i++)
cnt[c[i]+9000]++;
for(int i = pos+1; i < n; i++)
{
ret += cnt[(-c[i])+9000];
if(c[i] == 0)
ret++;
}
ret += cnt[9000];
return ret;
}
int main()
{
while(~scanf("%d", &n))
{
for(int i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
for(int i = 0; i < n; i++)
{
if(i)printf(" ");
printf("%d", Solve(i) + 1);
}
printf("\n");
}
return 0;
}