import scala.io.StdIn.{readLine,readInt}

object Main {

  def main(args: Array[String]) = {
    val n = readInt
    val a = Array.ofDim[Int](4,3,10)

    1 to n foreach { _ =>
      val Array(b,f,r,v) = readLine.split(" ").map(_.toInt)
      a(b-1)(f-1)(r-1) += v
    }

    for(i <- 0 to 3) {
      for(j <- 0 to 2) {
        for(k <- 0 to 9) {
          print(" ")
          print(a(i)(j)(k))
        }
        println()
      }
      if(i<3) {
        println("####################")
      }
    }
  }
}