import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val A = List.fill(N)(sc.nextInt)

  for (i <- 0 until N) {
    val xs = A.zipWithIndex.filterNot(_._2 == i).map(_._1).groupBy(identity).map(_._2.length)
    val y = xs.foldLeft(0)((z, x) => z + (1 to x).combinations(2).length)
    println(y)
  }
}
