{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eVasya is a ufologist and his duties include\r\nobserving Unidentified Flying Objects (UFOs)\r\nin the part of space bounded by a cube\r\n\u003ci\u003eN\u003c/i\u003e × \u003ci\u003eN\u003c/i\u003e × \u003ci\u003eN\u003c/i\u003e. \r\nThe cube is divided into cubic sectors 1 × 1 × 1. \r\nDuring the observation, the following events may happen:\r\n\u003cul\u003e\r\n\u003cli\u003eseveral new UFOs emerge in a certain sector;\u003c/li\u003e\r\n\u003cli\u003eseveral UFOs disappear in a certain sector;\u003c/li\u003e\r\n\u003cli\u003eVasya\u0027s boss may ask him how many UFOs there\r\nare in a part of space consisting of several sectors.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\r\nAt the moment when Vasya starts his observations there are no \r\nUFOs in the whole space.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains an integer \u003ci\u003eN\u003c/i\u003e (1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 128). \r\nThe coordinates of sectors are integers from 0 to \u003ci\u003eN\u003c/i\u003e–1.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThen there are entries describing events, one entry per line.\r\nEach entry starts with a number \u003ci\u003eM\u003c/i\u003e.\r\n\u003cul\u003e\r\n\u003cli\u003e If \u003ci\u003eM\u003c/i\u003e is 1, then this number is followed by four \r\nintegers\r\n\u003ci\u003ex\u003c/i\u003e (0 ≤ \u003ci\u003ex\u003c/i\u003e \u0026lt; \u003ci\u003eN\u003c/i\u003e), \u003ci\u003ey\u003c/i\u003e (0 ≤ \u003ci\u003ey\u003c/i\u003e \u0026lt; \u003ci\u003eN\u003c/i\u003e), \r\n\u003ci\u003ez\u003c/i\u003e (0 ≤ \u003ci\u003ez\u003c/i\u003e \u0026lt; \u003ci\u003eN\u003c/i\u003e), \u003ci\u003eK\u003c/i\u003e (–20000 ≤ \r\n\u003ci\u003eK\u003c/i\u003e ≤ 20000), \r\nwhich are coordinates of a sector and the change\r\nin the number of UFOs in this sector.\r\nThe number of UFOs in a sector cannot become negative.\r\n\u003c/li\u003e\r\n\u003cli\u003e If \u003ci\u003eM\u003c/i\u003e is 2, then this number is followed by \r\nsix integers\r\n\u003ci\u003ex\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ey\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ez\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e, \r\n\u003ci\u003ex\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ey\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ez\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e \r\n(0 ≤ \u003ci\u003ex\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003ex\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e \u0026lt; \u003ci\u003eN\u003c/i\u003e, \r\n0 ≤ \u003ci\u003ey\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003ey\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e \u0026lt; \u003ci\u003eN\u003c/i\u003e, 0 ≤ \r\n\u003ci\u003ez\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003ez\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e \u0026lt; \u003ci\u003eN\u003c/i\u003e), \r\nwhich mean that Vasya must compute the total number of UFOs\r\nin sectors (\u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e, \u003ci\u003ez\u003c/i\u003e) belonging to the volume: \r\n\u003ci\u003ex\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003ex\u003c/i\u003e ≤ \u003ci\u003ex\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e, \r\n\u003ci\u003ey\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003ey\u003c/i\u003e ≤ \u003ci\u003ey\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e, \r\n\u003ci\u003ez\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003ez\u003c/i\u003e ≤ \u003ci\u003ez\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e.\u003c/li\u003e\r\n\u003cli\u003eIf \u003ci\u003eM\u003c/i\u003e is 3, it means that Vasya is tired and goes to \r\nsleep. This entry is always the last one.\u003c/li\u003e\r\n\u003c/ul\u003e\r\nThe number of entries does not exceed 100002.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFor each query, output in a separate line the required number of UFOs.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n2 1 1 1 1 1 1\r\n1 0 0 0 1\r\n1 0 1 0 3\r\n2 0 0 0 0 0 0\r\n2 0 0 0 0 1 0\r\n1 0 1 0 -2\r\n2 0 0 0 1 1 1\r\n3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n1\r\n4\r\n2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}