More modulized with constaint that no word matched to different patterns
Lowest common ancestor and rewrite count the number of 7