create one blank line of output foreach substring take the first blank line if there is no overlap substr the blank line if there is overlap create a new blank line substr the new blank line