The Block Problem 

A painted wooden cube, such as a child's block, is cut into twenty seven equal pieces. First the saw takes two parallel and vertical cuts through the cube, dividing it into equal thirds; then it takes two additional vertical cuts at 90 degrees to the first ones, dividing the cube into equal ninths. Finally, it takes two parallel and horizontal cuts through the cube, dividing it into twenty seven cubes. How many of these small cubes are painted on three sides? On two sides? On one side? How many cubes are unpainted?