import Data.List

takeAndDrop :: [Int] -> Int -> [Int]
takeAndDrop lst n = (take (n-1) lst) ++ (drop n lst) 

countChoice :: [[Int]] -> Int
countChoice [] = 0
countChoice (x:xs) = (((lx - 1) * lx) `div` 2) + countChoice xs
                        where
                            lx = length x

groupSort xs = group $ sort xs

toInt x = read x :: Int

main = do 
    n' <- getLine
    aN <- getLine
    let n = read n'
        aList = map toInt $ words aN
        listaList = map (takeAndDrop aList) [1..n]
        newList = map groupSort listaList
    mapM_ print $ map countChoice newList