
fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val An = readLine()!!.split(" ").map(String::toInt)
    val employees: MutableList<MutableList<Int>> = (1..N).map { mutableListOf<Int>() }.toMutableList()
    // [i][j] = j belongs to i

    An.indices.forEach {
        employees[An[it] - 1].add(it + 2 - 1)
    }
    employees.forEach { row -> 
        row.size.run(::println)
    }
}