f | s = input() | f | s = input() |
n | x_up = y_up = z_up = -float('Inf') | n | x_hi = y_hi = z_hi = float('-inf') |
| x_down = y_down = z_down = float('Inf') | | x_lo = y_lo = z_lo = float('inf') |
| while s != '': | | while s != '': |
| (x, y, z) = map(float, s.split(',')) | | (x, y, z) = map(float, s.split(',')) |
n | if x > x_up: | n | if x > x_hi: |
| x_up = x | | x_hi = x |
| if x < x_down: | | if x < x_lo: |
| x_down = x | | x_lo = x |
| if y > y_up: | | if y > y_hi: |
| y_up = y | | y_hi = y |
| if y < y_down: | | if y < y_lo: |
| y_down = y | | y_lo = y |
| if z > z_up: | | if z > z_hi: |
| z_up = z | | z_hi = z |
| if z < z_down: | | if z < z_lo: |
| z_down = z | | z_lo = z |
| s = input() | | s = input() |
t | print((x_up - x_down) * (y_up - y_down) * (z_up - z_down)) | t | print((x_hi - x_lo) * (y_hi - y_lo) * (z_hi - z_lo)) |