#include <stdlib.h>
#include <string.h>
#include <math.h>
int main() {
int n,i,j,s=0,fish[1000];
scanf("%d", &n);
for (i =0; i <=n-1; i++) {
scanf("%d", &fish[i]);
}
for (i = n-1; i >= 0; i--) {
for (j = i - 1; j >= 0; j--) {
if (fish[i] > fish[j])
s++;
}
printf("%d ", s);
}
system("pause");
return 0;
}```