function Main(input) {
  // fillメソッドは一番ネストが深いところでのみ使う
  let table = Array.from(new Array(4), () =>
    Array.from(new Array(3), () => new Array(10).fill(0))
  );

  const args = input.trim().split("\n");
  let n = parseInt(args[0]);
  for (let i = 0; i < n; i++) {
    let b, f, r, v;
    // 分割代入!
    [b, f, r, v] = args[i + 1].split(" ").map((x) => Number(x));
    table[b - 1][f - 1][r - 1] += v;
  }

  for (let i = 0; i < 4; i++) {
    for (let j = 0; j < 3; j++) {
      let output = "";
      for (let k = 0; k < 10; k++) {
        output += " ";
        output += String(table[i][j][k]);
      }
      console.log(output);
    }
    if (i !== 3) {
      console.log("####################");
    }
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
