object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)
    val record = List.fill(4)(List.fill(3)(Array.fill(10)(0)))

    val n = scanner.nextInt
    for(_ <- 1 to n) {
      val b, f, r, v = scanner.nextInt
      record(b - 1)(f - 1)(r - 1) = record(b - 1)(f - 1)(r - 1) + v
    }

    for(b <- record) {
      for(f <- b) {
        println(" " + f.mkString(" "))
      }
      println("#" * 20)
    }
  }
}
