Solved lcsm problem