시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 44 23 18 56.250%

문제

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 \(X \times Y \times Z\) rectangular parallelepiped by arranging and piling up many \(1 \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)\) through \((X-1,Y-1,Z-1)\) as by the ordinary coordinate system, and Cubic calls the cube \((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)\) and \((x_2,y_2,z_2)\) is defined as \(|x_1-x_2| + |y_1-y_2| + |z_1-z_2|\).

On the current work, Cubic decides to use \(N\) colors, which are numbered from \(1\) to \(N\). He paints a cube with the \((i+1)\)-th color if the distance \(D\) between the cube and the origin cube satisfies \(D \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.

입력

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

출력

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

예제 입력

2 2 2 0 0 0 5

예제 출력

1 3 3 1 0

예제 입력 2

4 3 3 1 1 1 3

예제 출력 2

13 10 13

예제 입력 3

2000 2000 2000 1000 1000 1000 1

예제 출력 3

8000000000

힌트