from collections import deque from sys import stdin def main(): N = int(input()) A = stdin.read().splitlines() A = list(map(int, A)) for n in range(N): a = deque(A) a.rotate(-n) print(program(a, N)) 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()