import scala.io.StdIn

object Main extends App {

  val result = Array.fill(4,3,10)(0)
  
  val n = StdIn.readLine().toInt
  (0 until n).foreach{ i =>
    val Array(b, f, r, v) = StdIn.readLine().split(' ').map(_.toInt)
    result(b-1)(f-1)(r-1) += v
  }

  private final val border = "#"*20
  
  println(
    result.map { b =>
      b.map { r =>
        " " + r.mkString(" ") + f"%n"
      }.mkString("")
    }.mkString(border + f"%n") + f"%n"
  )
}
