Question 23
Let $n$ be a positive integer greater than $1$. A large $n \times n \times n$ cube is made up of $n^3$ small cubes of side length $1$. Each small cube is painted with one colour. From this large cube we cut out, along the direction of the $x$-axis, $n$ different $1 \times n \times n$ boxes $R_1, R_2, \cdots, R_n$. Let $C_i$ be the set of colours of all the small cubes in $R_i$, and let $\mathcal{X} = \{C_1, C_2, \cdots, C_n\}$. In the same way, let $\mathcal{Y}$ be the set obtained by cutting out $n \times 1 \times n$ boxes along the direction of the $y$-axis, and let $\mathcal{Z}$ be the set obtained by cutting out $n \times n \times 1$ boxes along the direction of the $z$-axis.
Suppose we know that, for $\mathcal{X}, \mathcal{Y}$ and $\mathcal{Z}$, if a colour set belongs to one of them, then it also belongs to the other two. Find the maximum possible total number of colours of these $n^3$ small cubes (in terms of $n$).
(Example: if $R_1$ contains the three colours red, blue and green, then $C_1 = \{\text{red, blue, green}\}$.)
Suppose we know that, for $\mathcal{X}, \mathcal{Y}$ and $\mathcal{Z}$, if a colour set belongs to one of them, then it also belongs to the other two. Find the maximum possible total number of colours of these $n^3$ small cubes (in terms of $n$).
(Example: if $R_1$ contains the three colours red, blue and green, then $C_1 = \{\text{red, blue, green}\}$.)