buildings = []
4.times do |i|
  floors = []
  3.times do |j|
    rooms = []
    10.times do |k|
      rooms[k] = 0
    end
    floors[j] = rooms
  end
  buildings[i] = floors
end

n = gets.to_i
n.times do |i|
  b, f, r, p = gets.split.map(&:to_i)
  buildings[b - 1][f - 1][r - 1] += p
end

4.times do |i|
  if i != 0 then
    puts "####################"
  end
  3.times do |j|
    10.times do |k|
      printf(" %d", buildings[i][j][k])
    end
    puts
  end
end

