bld=Array.new(4){Array.new(3){Array.new(10,0)}}

n=gets.to_i
for i in 1..n do
   mp=Array.new()
   mp=gets.split(' ').map(&:to_i)
   bld[mp[0]-1][mp[1]-1][mp[2]-1]+=mp[3]
end

bld.each_with_index{|b,i|
    b.each{|f|
      f.each{|r|
        printf(" %d",r)
      }
      printf("\n")
    }
    if(i<3) then
    printf("####################\n")
    end
}