fun main(args: Array<String>) {
    val buildingNum = 4
    val floorNum = 3
    val roomNum = 10
    var information = Array(buildingNum) {Array(floorNum) {Array(roomNum) {0}}}

    repeat(readLine()!!.toInt()) {
        val (b, f, r, n) = readLine()!!.split(" ").map(String::toInt)
        information[b - 1][f - 1][r - 1] += n
    }

    information.forEachIndexed {
        building, infoBuilding -> infoBuilding.forEachIndexed {
            _, infoFloor -> infoFloor.forEach { print(" $it") }
            println()
        }
        if (building != buildingNum - 1) {println("#".repeat(20))}
    }
}

