Three colored cubes on a surface