Solution of the Sherlock and the Beast was implemented.