Rainbow in a cube