import Data.List
import Control.Monad

main = do
  str <- getLine
  let n = read str ::Int
  str <- getLine
  let as = take n $ map read (words str) ::[Int]
  forM_ [1..n] $ \i -> do
    let a = map (\xs -> func (length xs)) $ (group . sort . (mkList i)) as
    print$ sum a


func :: Int -> Int
func m
  | m == 1    = 0
  | otherwise = floor $ fromIntegral (m * (m-1)) / 2


mkList :: Int -> [Int] -> [Int]
mkList num list
  | num == 1           = tail list
  | num == length list = init list
  | otherwise          = take (num-1) list ++ drop num list