The solution can be represented evidently, if you imagine conditionally each cube as three mutually perpendicular axes. The letters at the ends of axes designate colours of the appropriate sides, which are perpendicular to the axes (W - white, B - black).