import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import qualified Data.Map.Strict as Map

readInt :: B.ByteString -> Maybe (Int,B.ByteString)
readInt xs = do
    (x,ys) <- B.readInt xs
    return (x,B.tail ys)

analyze :: Map.Map Int Int -> [Int] -> Map.Map Int Int
analyze xx []     = xx
analyze xx (x:xs) = case Map.lookup x xx of
    Just y -> analyze (Map.update (\x -> Just (x+1)) x xx) xs
    Nothing -> analyze (Map.insert x 1 xx) xs

fun :: Int -> VU.Vector Int -> Map.Map Int Int -> Int -> Int
fun sums yy xx m = case Map.lookup (yy VU.! m) xx of
    Just z -> -z + 1 + sums
    Nothing -> sums

main :: IO ()
main = do
    n <- readLn
    as <- VU.unfoldrN n readInt <$> B.getLine
    let bs = VU.toList as
    let cs = analyze Map.empty bs
    let sums = Map.foldl' (\a b -> a + ((b*(b-1)) `div` 2)) 0 cs
    let ans = map (fun sums as cs) [0..n-1]
    mapM_ print ans