import scala.collection.mutable

object Main extends App {
    val lines = io.Source.fromInputStream(System.in).getLines()
    val n = lines.next().toInt
    val as: Seq[Int] = lines.next().split(" ").map(_.toInt).toSeq

    // Count by each kind of A_i
    val counts: mutable.Map[Int, Int] = mutable.HashMap.empty[Int, Int]
    for (a <- as) {
        counts.get(a) match {
            case Some(x) => counts.put(a, x + 1)
            case None => counts.put(a, 1)
        }
    }

    for (i <- 0 until n) {
        val reserved = as(i)
        var sum = 0
        for ((a, n) <- counts) {
            val m = if (a == reserved) { n - 1 } else { n }
            sum += m * (m - 1) / 2
        }
        println(sum)
    }
}
