Imagine a three dimensional version of tic, tac, toe where two players take turns placing different colored marbles into a box.

The box is made from $n^{3}$ transparent unit cubes arranged in a $n$-by-$n$-by-$n$ array.

The object of the game is to complete as many winning lines (vertical, horizontal or diagonal) of n marbles as possible.

Can you work out the solution for any $n \times n \times n$ cube?