CMIMC 2019 Power Problem 2.2

Prove that if S^{\prime} has an n^{2} coloring then there is a valid Sudoku solution (up to permutation of the numbers \left.1,2, \ldots, n^{2}\right).