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

object Main extends App {
  val n     = readInt()
  val lines = Iterator.fill(n)(readLine())

  val offices = {
    val offices = Array.fill(4, 3, 10)(0)
    for (line <- lines) {
      val Array(b, f, r, v) = line.split(" ").map { _.toInt }
      offices(b - 1)(f - 1)(r - 1) += v
    }
    offices
  }

  val sep    = "####################"
  val result = for {
    office <- offices
    stories = office.map { _.mkString(" ", " ", "\n") }
  } yield stories.mkString

  print(result.mkString(sep + "\n"))
}

