Imports System.Collections.Generic
Module D
    Sub Main(ByVal args() As String)
        Dim N As Integer = Integer.Parse(Console.ReadLine())
        Dim arr() As String = Split(Console.ReadLine())
        Dim A_i() As Integer = Array.ConvertAll(Of String, Integer)(arr, AddressOf Integer.Parse)
        Dim wkarr(N - 1) As Integer
        Dim i, all As Long
        For i = 0 To N - 1
            wkarr(A_i(i) - 1) += 1
            all += wkarr(A_i(i) - 1)
        Next
        For i = 0 To N - 1
            Console.WriteLine(all - wkarr(A_i(i) - 1) - (N - 1))
        Next
    End Sub
End Module