#0000CF

z-green

Mister Little Z. got a funny toy as a Christmas present. The toy is a cube made of N by N by N blocks. When the toy is turned on all the blocks are black. Mister Little Z. can issue the following commands to the toy:

- ADD x y z, in which case the block at location (x,y,z) gets painted green.
- Q x1 y1 z1 x2 y2 z2 in which case the toy reports how many blocks in the area where x1 <= x <= x2, y1 <= y <= y2, z1 <= z <= z2 are painted green.


However one day the toy fell down and broke. Now, you want to write a program that will simulate the toy, so that Mister Little Z can have some fun time


InputThe input is read from the standard input. From the first line read two integers N and M (1 <= N <= 200, 1 <= M <= 20000), representing the size of the cube and the number of commands that Mister Little Z. issued to the cube.

Each of the next M lines describes a command, in the format explained above. All the coordinates will be in the range [1 N ]

OutputTo the standard output write MQ lines, where MQ is the number of Q commands. Each line representing the answer to the question in the order they were asked


Input:

3 6
ADD 2 2 2
Q 1 1 1 2 2 2
ADD 1 1 1
Q 1 1 1 2 2 2
ADD 2 2 2
Q 1 1 1 3 3 3

Output:
1
2
2

Explanation: A the block (2,2,2) was already painted green, so repainting it didn't increase the number of painted blocks


Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.