Solution to the Beautiful Strings problem.