import Control.Monad
import qualified Data.IntMap as IntMap

toIntMap :: Int -> [Int] -> IntMap.IntMap Int
toIntMap n [] = IntMap.fromList (map (flip(,)0) [1..n])
toIntMap n (x:xs) = IntMap.insertWith (+) x 1 (toIntMap n xs)

fact 0 = 1
fact n = n * fact (n-1)

main = do
  n <- read<$>getLine
  as <- (map read) . words<$>getLine :: IO [Int]
  forM_ [0..(n-1)] $ \k -> do
    let excpt = (take k as) ++ (drop (k+1) as)
    let f v = v * (v-1) `div` 2
    print $ IntMap.foldl (+) 0 $ IntMap.map f $ toIntMap n excpt