Description of sequences defined by billiards in the cube