Gromah and LZR have entered the fourth level. There is a blank cube with sizen×m×hntimes mtimes hn×m×h hanging on the wall. Gromah soon finds a list beside the cube, there areqq_{}q instructions in the list and each instruction is in one of the following two formats: 1. _{}, meaning to add a tag on position_{} in the cube 2. _{}, meaning to determine the minimum Manhattan Distance to the given position _{}among all tagged positions Manhattan Distance between two positions,, , is defined as ∣x1x2∣+∣y1y2∣+∣z1z2∣|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|∣x1x2∣+∣y1y2∣+∣z1z2∣. LZR also finds a note board saying that the password of this level is the sequence made up of all results of the instructions in format 2. Please help them get all results of the instructions in format 2.
Gromah and LZR have entered the fourth level. There is a blank cube with size n×m×hntimes mtimes hn×m×h hanging on the wall. Gromah soon finds a list beside the cube, there are qq_{}q instructions in the list and each instruction is in one of the following two formats: 1. (1,x,y,z)(1, x, y, z)_{}(1,x,y,z), meaning to add a tag on position (x,y,z)(x, y, z)_{}(x,y,z) in the cube 2. (2,x,y,z)(2,x, y, z)_{}(2,x,y,z), meaning to determine the minimum Manhattan Distance to the given position (x,y,z)(x, y, z)_{}(x,y,z) among all tagged positions Manhattan Distance between two positions (x1,y1,z1),(x2,y2,z2)(x_1, y_1, z_1), (x_2, y_2, z_2)(x1,y1,z1),(x2,y2,z2) is defined as ∣x1−x2∣+∣y1−y2∣+∣z1−z2∣|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|∣x1−x2∣+∣y1−y2∣+∣z1−z2∣. LZR also finds a note board saying that the password of this level is the sequence made up of all results of the instructions in format 2. Please help them get all results of the instructions in format 2.