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(n): for j in range(n - 1): if a[j] > a[j+1]: a[j], a[j+1] = a[j+1], a[j] cnt += 1 return cnt main()