import Data.List
import Control.Monad

main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  ks <- map read . words <$> getLine :: IO [Int]
  forM_ [1..n] $ \i -> do
    let (bef,(_:aft)) = splitAt (i-1) ks
        banned = bef ++ aft
        sorted = sort banned
        grouped = group sorted
        pairs = map length grouped
    print . sum $ map (`combination` 2) pairs

combination :: Int -> Int -> Int
n `combination` m = (product $ take m [n,n-1..1]) `div` (product [m,m-1..1])
