#icpc2014springb. [icpc2014spring_b]Cube Coloring

[icpc2014spring_b]Cube Coloring

MathJax.Hub.Config({ tex2jax: { inlineMath: [["","",""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }

Problem Statement

Great painter Cubic is famous for using cubes for his art. Now, he is engaged in a new work of art. He tries to form an XtimesYtimesZX \\times Y \\times Z rectangular parallelepiped by arranging and piling up many 1times1times11 \\times 1 \\times 1 cubes such that the adjacent surfaces of cubes are fully shared.

Of course, he won't finish his work only arranging and piling up cubes. The position of each cube is denoted by (0,0,0)(0,0,0) through (X1,Y1,Z1)(X-1,Y-1,Z-1) as by the ordinary coordinate system, and Cubic calls the cube (A,B,C)(A,B,C) the origin cube. Then, he paints a pattern on the rectangular parallelepiped with different colors according to the distance between each cube and the origin cube. He paints all cubes regardless of whether or not a cube is visible externally. This is his artistic policy. He uses Manhattan distance as the distance between cubes. The Manhattan distance between two cubes (x_1,y_1,z_1)(x\_1,y\_1,z\_1) and (x_2,y_2,z_2)(x\_2,y\_2,z\_2) is defined as x_1x_2+y_1y_2+z_1z_2|x\_1-x\_2| + |y\_1-y\_2| + |z\_1-z\_2|.

On the current work, Cubic decides to use NN colors, which are numbered from 11 to NN. He paints a cube with the (i+1)(i+1)-th color if the distance DD between the cube and the origin cube satisfies DequivipmodND \\equiv i \\pmod{N}.

Cubic wants to estimate the consumption of each color in order to prepare for the current work. He asks a great programmer, you, to write a program calculating the number of cubes that will be painted by each color.


Input

The input contains seven integers XX, YY, ZZ, AA, BB, CC, and NN. All integers are in one line and separated by a single space. Three integers XX, YY, and ZZ (1leqX,Y,Zleq1061 \\leq X, Y, Z \\leq 10^6) represent the length of each side of the rectangular parallelepiped that Cubic tries to form. Three integers AA, BB, and CC (0leqAltX0 \\leq A \\lt X, 0leqBltY0 \\leq B \\lt Y, 0leqCltZ0 \\leq C \\lt Z) represent the position of the origin cube. The number of kinds of colors is denoted by NN (1leqNleq1,0001 \\leq N \\leq 1{,}000).

Output

The output contains NN integers in one line. The ii-th integer (1leqileqN1 \\leq i \\leq N) represents the number of the cubes that will be painted by the ii-th color. All integers must be separated by a single space.


Sample Input 1

2 2 2 0 0 0 5```

### Output for the Sample Input 1

```plain
1 3 3 1 0```

* * *

### Sample Input 2

```plain
4 3 3 1 1 1 3```

### Output for the Sample Input 2

```plain
13 10 13```

* * *

### Sample Input 3

```plain
2000 2000 2000 1000 1000 1000 1```

### Output for the Sample Input 3

```plain
8000000000```

* * *

### Source Name

[Japan Alumni Group Spring Contest 2014](http://acm-icpc.aitea.net/index.php?2013%2FPractice%2F%BD%D5%A5%B3%A5%F3%A5%C6%A5%B9%A5%C8%2F%B0%C6%C6%E2)

* * *