Solve MagicalStringDiv2