import Data.List

sortN :: [Int] -> [[Int]]
sortN xs = group $ sort xs

-- sortN xs = group $ quicksort xs
--             where
--                 quicksort [] = []
--                 quicksort (y:ys) = quicksort smaller ++ [y] ++ quicksort larger
--                                     where
--                                         smaller = [a | a <- ys, a <= y]
--                                         larger  = [a | a <- ys, a > y]

countChoice :: [[Int]] -> Int
countChoice xss = sum $ map eachLength xss
                    where
                        eachLength zs = (lzs * (lzs - 1)) `div` 2
                                        where
                                            lzs = length zs

negKList :: Int -> [Int] -> Int -> [Int]
negKList baseNumber baseList n = map negK [1..n]
                where
                    negK :: Int -> Int
                    negK n = baseNumber - deleteK baseList n
                                where
                                    deleteK baseList k = (length $ filter (==(baseList !! (k-1))) baseList)  - 1

toInt x = read x :: Int

main = do 
    n' <- getLine
    aN <- getLine
    let n = toInt n'
        baseList = map toInt $ words aN
        sortedList = sortN baseList
        baseNumber = countChoice sortedList
    mapM_ print $ negKList baseNumber baseList n