import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    var count = Array(4,{Array(3,{Array<Int>(10,{0})})})

    val n = cin.nextInt()
    for(i in 1..n) count[cin.nextInt()-1][cin.nextInt()-1][cin.nextInt()-1] += cin.nextInt()
    

    for(i in 0..3){
	    for(j in 0..2){
	        for(k in 0..9){
		        print(" ${count[i][j][k]}")
	        }
	        println()
    	}
	    if(i < 3) println("####################")
    }
}

