AC:
#include <stdio.h>
#define rep(i, a, b) for(int i = a; i <= b; i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define ll long long
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 10010;
int main(int n, char**v)
{
int dp[N], a[N];
for (int i = 0; scanf("%d", &a[i]) && i < (n = a[0]); dp[i++] = 0);
for (int i = 2; i <= n; i++)
for (int j = 1; j < i; j++)
if (a[j] < a[i]) dp[i] += 1;
for (int i = 1; i <= n; i++)
printf("%d ", dp[i]);
return 0;
}