import Control.Monad
import qualified Data.IntMap as IntMap

toIntMap :: Int -> [Int] -> IntMap.IntMap Int
toIntMap n [] = IntMap.empty
toIntMap n (x:xs) = IntMap.insertWith (+) x 1 (toIntMap n xs)

main = do
  -- let n = 2 * 100000  -- n=2000   ->  1.6s
  -- let as = replicate n 1
  n <- read<$>getLine
  as <- (map read) . words<$>getLine :: IO [Int]
  --preJikkou <- getCurrentTime

  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