#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)2e5 + 5;
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const long long mod = (int)1e9 + 7;
int n, m, x, y;
int a[MAXN], cnt[MAXN], res[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) cin >> a[i];
  for (int i = (1); i <= (n); i++) {
    memset(cnt, 0, sizeof(cnt));
    ;
    cnt[a[i]]++;
    res[a[i]]++;
    int id = a[i], min1 = 1;
    for (int j = i + 1; j <= n; j++) {
      cnt[a[j]]++;
      if (min1 < cnt[a[j]])
        min1 = cnt[a[j]], id = a[j];
      else if (min1 == cnt[a[j]] && a[j] < id)
        id = a[j];
      res[id]++;
    }
  }
  for (int i = (1); i <= (n); i++) printf("%c%d", i == n ? '\n' : ' ', res[i]);
  return 0;
}
