#include <iostream> using namespace std; const int N = 1001; int n, a[N], s[N][N]; int main() { cin >> n; for(int i = 1; i <= n; i += 1) cin >> a[i]; for(int i = 2; i <= n; i += 1) for(int j = 1; j + i - 1 <= n; j += 1) { int L = j, R = j + i - 1; s[L][R] = s[L + 1][R] + s[L][R - 1] - s[L + 1][R - 1] + (a[L] > a[R]); } for(int i = 1; i <= n; i += 1) for(int j = i; j <= n; j += 1) cout << s[i][j] << endl; }