import scala.io.StdIn
import scala.annotation.tailrec

/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {

    val house = Array.ofDim[Int](House.building, House.floor, House.room)
    for (_ <- 1 to StdIn.readInt()) {
      val in = StdIn.readLine().split(" ").map(_.toInt)
      house(in(0) - 1)(in(1) - 1)(in(2) - 1) += in(3)
    }
    for(i <- 0 to House.building - 1; j <- 0 to House.floor - 1){
      println(" " + house(i)(j).mkString(" "))
      if(i < House.building - 1 && j == House.floor - 1){println("#" * 20)}
    }
  }
}

object House {
  val building = 4
  val floor = 3
  val room = 10
}