solve 'scunthorpe problem' for some strings