from collections import deque from sys import stdin def main(): N = int(input()) A = stdin.read().splitlines() A = list(map(int, A)) a = deque(A) for _ in range(N): print(program(list(a), N)) a.rotate(-1) def program(a, n): cnt = 0 for i in range(1, n): for j in a[:i]: if j > a[i]: cnt += 1 return cnt main()