def output(pos)
  for i in 0..3 do
    for j in 0..2 do
      for k in 0..9 do
        printf " %d", pos[i][j][k]
      end
      printf "\n"
    end
    printf "####################\n" if i < 3
  end
end
# initializing of room
pos = Array.new(4){Array.new(3){Array.new(10,0)}}

n = gets.to_i
n.times do
  arr = gets.split(" ").map(&:to_i)
  pos[arr[0]-1][arr[1]-1][arr[2]-1] += arr[3]
end
output(pos)