A magic cube is a number of integers arranged in a n x n x n pattern such that the sum of the numbers on each row, each column, each pillar and the four main space diagonals is equal to a single number, the so-called magic constant of the cube.
Construct a 3x3x3 magic cube with numbers $1, 2, \dots, 3^3$.