
object Main {
  def main(args: Array[String]): Unit = {
    val array = Array.ofDim[Int](4, 3, 10)
    val n = scala.io.StdIn.readInt()
    for (i <- 0 until n) {
      val line = scala.io.StdIn.readLine().split(" ").map(_.toInt)
      array(line(0) - 1)(line(1) - 1)(line(2) - 1) += line(3)
    }

    for (b <- 0 until 4) {
      for (f <- 0 until 3) {
        println(" " + array(b)(f).mkString(" "))
      }
      if (b < 3) {
        println("#" * 20)
      }
    }
  }
}