In a $7\times 7\times 7$ cube, the unit cubes are colored white, black and gray colors so that for any two colors the number of cubes of these two colors are different. In this case, $N$ parallel rows of $7$ cubes were found, each of which there are more white cubes than gray and than black. Likewise, there were $N$ parallel rows of $7$ cubes, each of which contained gray there are more cubes than white and than black, and there are also N parallel rows of $7$ cubes, each of which contains more black cubes than white ones and than gray ones. What is the largest $N$ for which this is possible?
Problem
Source: 2022 South Russian Girls MO - Assara Seniors p7
Tags: Coloring, combinatorics, geometry, 3D geometry