Sample test case running properly in custom case but gives error while submission


#1

Test Case:
95 babaabbbbabbaabbbbbaababbbbbbbaaaaabaabaaaabababbbababaababaabbbbaababbbaaaaababbababbaaababbbaaaaab abbbaaaabbbabaabbbabaaaabababaababbabbaabbabaaabbbbbaaaabababbbbaaabbaaabbbbbaabaaaabbbbbbbbbaaaabaa babbababaabaaaaaaabaabaabaabbabaabbaabaaabaaaaaaabbbabbbbbbbaaaabaaaababaabbbbbaaabbbaaaabbabababbab abbabaaabbaabbabaaabbaaaabaaaaaaabbabababbbbbaababbbbbabaaaaabaabbabbbaabbabaaaaabaaabaabbaaabbaaabb abbbaaababbababababbbaabaababbababbabaaababaabbababaabbbaaaaaababbbbabaababbbababaaabaaaaaaaaabbbabb bbbaabbabbaabaaabaaaaabbaababbaabababaabaaaaaabaababbbbbaaabbaaaaaababbabbabbabbaaaaaabaabbbaaaabaaa bbabbaababababababababbbabbabbbbbbbbaaabababbabaaaaabbaabbbaaabbbbbbbbbbbbabaaaabbabaaaababbbaabbabb bbabbbbabbbbbaabaaabbaaabbaaaaaaaabbbbaabbabbaababaababaababaaabaaabbaaababbbbabbababbabbbaabaaabbbb bbababbaabbababaaaabbabbbabaaaabbbbababaaaababbaabbaaabbbabbbbbbaababbaabababbababbbaababbaaabbabbbb babbaaaaabbaabbbaabbabaabbaabaaaaabaabaaabbababbaabbbbaabbbaabbaabbabbaabbabbbaabbaabbbabbabbabaabba abaaabbabaaaaaaaababaabaaaabbbbabbbbbaabbbabaaababbbbbaababbaabbabbbabbababaababbaabaaabbabbaabbbaab bbbabbbbabbbabaabaabbbbabbaaaabbbbbabaabbaabaababaaaabaabaaabababbbabbbbaaaabbbaaaabbabbaabbbbaaabbb bbbaaaababaababbaaabababaaaaabababababbbaabbbabbaaabbaababbabbaaababbabaaabaababbbaabbbbaaaabbbbbaba babbbbbabaababbabbbbbbbaaabaaabaaabbbaababaaababaababbbbabbbbabbbaabaaaaaaaaabbabbbaaabaaaaaabababaa babbbbabbbbababbabbbabbbbbabaaabaabbbaaaaababaababaabaababbbabbaaaabbbbbbbbbbaaaaaaaaabaabbaaaabbaba abaaaaabbaabababbbababbbbabbabbbaaababbaabaabaaaaaabbaaaabababbaaaababbbabaabbbababbaabbbbbaabababab aaabbbaabaaabbababbbbaabaaaaabaabaabbababbbabbaabbbababbbbabaaabababbabbaaabaaabbabaaabaaabbbbabbabb bbbabaabbbbabaabbbaababbaaabaaabbaabbaabbbbaabbbbaabaababaabbabbabbabaaabbbaabaabaaabbbaabbbbabababa bbbbbbbbaaababbbbbbaaaababbbbababaaababbbaabbabbbbaabbaababbbbbbaabbbabbbbbaabbbbbbababbabbabababaab babaaabaaaabbaabaaababababbaaaababaaabbabaaababaabbbabbabbabaabbbbabaabbaabbabbbbabbbbbbabbabaababaa baabaaabbaabbababaaaaabbabbabbaabbbbababbabbbbbbababaabbbbabaaaaaaabbaabbbaabbbaababbbaaaaaaaaaabbab abbaabbabbbbaaabbaaabaabbbabaababaabbaaaababaabbaaaababaaaababbaabbabaababaaabababbaaaabbaaabbaaabaa aaabbbaaababaaaaabaaabbbaabababaaaababbbbbbbaaabaaabbbbabaaababbbbbbbbbaabbabababaabaaaababbaabbbaaa bbababaaabababababbaababbaabaabbabbbaaabbbabbbaaabbaaaaabbbbaaabbaaabbabaababbbbbaababbbbbaabbabbbba aaabbaabababaaaaaaabbbbaaabaaaaaaababbbaaaaaaabbaabbbbaaaabaabbbaaabaabaaabaababaaabbbaaaabbbbbaabba ababaaabbbaabbaaababbaaabbaaababbbbbbbaaaababaabbabbbbabbabbabbbabbbaaaabbbabbbbaabbbaabbbabbaabbbab bbabbabbbabbabbabbababaaaaabbbbbaabbbbabbbabaaaaaabbabbbabaabbbbbaaaaaababbabbbbbababbbbaabbababbbba aaaaaabbaabbbaaabaaaabaaaabaabbbaaabaaabaabaaaaaabaaabaababbabaaabaabbbbaababbabbbababababbbaaabbbaa bbbbbbbbaabababbaabbbbbabbaaaaaaabbbabaabbaababaaabbbaaabaabbaabaababbabbbbbbbbbbbaababaaaabaabbaabb baabbaabaababbaaabbaaaabbbbbaabbbbbabababbaaabbbbbbabaaabaabbaaababbbbabbbaaaabbbbbbabbababbbabababb abaaaaabbbbabaabaabbbbabbbbbbbbabaabbaababbbabaababbbaaabbbabbbabbbbabaaabaaabbababbbbabbababababbab aaaaaababbaababababbaababbaaabbbbbabbabbababbbbaabaaabbaaaabbabbbbbbbbababbaaabbbaababbababbbabababb babbbaababaabbbaabbbbbaaabbababbbabaaabbaaaaabbbaabbbabaabbbabbbabbbaaabaabbbbaaabbbbababaaabbbabbbb bbbabaaabaabbaaaabbaaaaabbbbaaaabbbbabbbaaabbbbbbaababbaaabbaaabbbabbbabaaabbbababaabbaaabaaaabbbbba abbbbbbbaaaaabaaabbbbaaaababbbaabaaaaabbabbbbbabbbbaaaabaaaaaaaaaababbbbabbabbabbabbbbbbaaaabbaaaaab abaaabaaabaaababaabbbaabbbabaaababbbbabbbabbbbaaababaaababbbbaaaababababbabaabbaaaabbaababaaaababbba bbbabbabbbbaabaaabbabbbbbabbaaaabaaaaabaabaabbbabbbabbabbaaabbaaabbaabaaabbbbbbabbbbbbabbabbaaaabbba abbababbbbaaabaaabbbababaababbbaabaababaaaaaababbaaaabaabbbaabaaabaabbbbbbabababbbabbbbabbbaaaababbb baabaaaaaabaaabbabbaabbbbbabababbbbbaaaabbbaabaabaabbbbbabbaabaababbbaaaaaabbbbbbabaabaaaabaaabbaabb babaabbaaaaabbaaababbbababaababbbaaabaaaaababaabbbbbbaaaaabaabbbabbbbaababaabaaaaabbaabbbabababbbbbb aabbaabbabbaaabaabaabbbaababbbbbaabbabbbbababbababbaaaaaaaaaabaabaabbbbbabaaaaabbabbbbaabababaaabbbb bbbabbbbbaabbaabbbabbbababaaabaabbaaaabbababbabaaabbbbababbbabbaaaaabaaabbbbaaaababbabaababaabbabbaa abaabbaaaabaabbbabaabbbaaaaaaabaabbbbbaaaaaabbabaaaabaabaabbababaabaaabbabaabbaaaaabbbabaababbabbaab bababaaaaaabbbbbbbaaaabbbabaabbabbbbbbbbabbbbbbbbbabababaabaaababbaabaaaababbbaabbbabbaaaababababbab babbabbaaabbbaaaaaabaaaaaabbbbababbabbbbabaaabaaababbbbbbbabaabbabaababaabbababaaabbbabbabaabbbabaab bbabaabbbbabbabbaabbbabbbbababbabaaabbababbbbbbaabbbbbabbbabbbbaabbbabababbabaaabaabbabbaaaababaabab baabbbaabbababaabaaabaaaabbaabbabababbaaaabaaabbaaabbbbbabbababaaabbaabbabbabababbaaaaabababbababaab aabbbbaabaabbaabaaaababaaabaabaabbabbaababaabbbbbbaabbababbbbaabbabbabbababaaabababababaababbbababab bbabbbbbabbaabbbbaabaababababbaaaaaaababbbabbbbbbbbaaabbbababbbbbbbbabbbbabbbaabbbbabaabbabababaaaab baabababaababbabbbaabaaababbabaababababbabababaabaababbaaaababbabbaaabaaabbaaaabbaaaaaaaabbbbbababba baaabbaabaaababbbaaaabbbabbaaaabbabbbaababbbbabababbaaaaabababababaababababababbabbababbbbaaabbbbbba bbbbbbaaaaabbbbbaaababaaaaaabaabbababbaabaaababbbabbbaaabbbbabbbabbbbabbbaaaaaababbbbaabbbbbabbbabbb babababbbbbabaaaaaaaaabbbbabaabaaabababaaaababbbbbbbbbbbabbaabbbbabbabbabbabbbabaabbaaabaaababbbaabb abbbaaabaaaabbbbbabbabbababaababbabaabbbbaaaababbabbabababbabababbbababbabaaaaabbaaabaaaaaabaaabaaaa bbabbabaabbabbbbaabaaaaababababbbaaabbabbbaabbaaaaaaabbbabaababbabbbbbbbbbbababaaabbaabaababbababaaa abaaaabbbbaabbbaaabbabbabaaaaabbababaaabbbbaaabbabababbaabbabaaaababbbababbaabbababbaaaaaabbabbbaaba baabbababaaabbaaabababababbbabaabababbaabbbbbaabbabaaababbaaaaaabaaabbabaabbbabbbbbabbbaaabbbabaaaab aababbaabbbbaababbabbbaaabbbbaaabaaabbbabbbabbaabababbabbbabbbbaaabaabbbbabbaaabbbbababababbaababaaa babbaaaaaaaaaaababbbbaababbbbbbbaaaaabbbabbbabaaabbbbaaababaaabbbaabaabaababbbaaabbbabbababbabaabbab aaaabaabaaaabbaababababaabbabaaababaababaabaaabbabbbbbbaaaaabbaabaaaabbbbaababbabbbabbbbabbaabbababb baaaaababbbaabbaababbbabaaaabaababaabbababaaaabbabbabaaaaaaaaaaabbbbbaabbaabbabaabbbabbabaaaabaabbba bababaabaaaaabababbaaabbabbbbbbabbbaaabbbbaaabbbaaabaabbbbbbaaaaababbabbabbbbbbabbabbbabaaaaabaaaaaa bbbbabbbaabbabbaaabababbbbaaaaaaaaabaabaabbbbaabbaababbaaaabbbbaaabaabbaaaabaaabaabbaabbbbbaaabbaaaa abaaababaabaaaababaabaaaabaabbaabbabbaaaabaabbbbabbbbbaabaaaabbbbabbbaabaabaaaabaaaaaaabaabaaaabbbab bbabbbbaaaaabbaabbaababbabbbbabbabbaaababaababbbbaabbbbbbbbbabbbabbabbbbbbaabababaabbaababaabaabbbba baabaabbbbabababbbabbbbbaaaabaaaaaaababbbbabbababbbbaabbaaabbabbaababaaaababbabababbaaabbbbbbbbbabbb bbaabbaabbbbabbbbbbabbbaabaaababaaaabbabaaaaabbaaaabababbaaabbbabaaaabbbbbbbbbabbabbbaaaaababbbbaaab bbabaabaaababbbabbbaabbabaababbaabababbbbabbaabbababbbabaaabbbabaababaaabbbabbbbbbbbabaabbbaaaaaaaba aaaabbbbbbbbbabaaaaaaabababaaaaaaaaaaaaabbbaabbabbbbbbbaababbababaaabbaaaabbbabababbbaababbabaaabaab aaababbabbbaababababbaabaabbabbabaabbaaaaababababbaaabbbbaaaaabbaaaaabaaaabaaabbabaabbbababbbabababa bbbbbababaabbbabaabbaabbaabbbabaabbabbbaababbbbbbaababbabaabbbabbbbbbababaabbbbabaababaabbaabbabbbbb babbbbaabbababababaaabaabbbabbaabbaaabaaababbabaaaabbabbabaaabababaaabaabbababbbbababababbaaababbbab baaaabbbbbaaabbababbbbbabbaabbaaababababbbaaaaaaaaaababbbbbaabbabaaaaaababbaabbabbabbabaabaabbabaaab bbabaabbbbbbbabbbbbbbbaabaababaabbabbabbbbaabbbbbaababbabbbbbbbabbababbbbbbbbbabbbbabaabababababbbba aaaabaaaabbbbabbbaababbabaaaaabbbbaaabababaaabaababaabbabbabaaabbabbbabbaabaaaaabaaabaabbbbbbbbaabbb baabaabbaaabaaaaabbaaabbbababbbabaaaabaabbbabbabbbbaabbbbaabbaaabaabaababbbbababbbabbaabbabbbbbaaaab bbbbbbaabbbbbaaaabbaabbabaabbaabbabbbababaabaabbaaabbbbaaaababaababaabbaabbaaababbaaaaabbbbbababaabb baababbaabbbbabbabbaabaabbbaabbbbbaaaaaabbabaaabaababbaaaaababbabbabbabbbbaababbbbababbabbbabaaababb abbaaabaaaabaaaabaabababbbbbbaaaaaaaaababbbbbbbaabbabbabbbbbbbbaabbaabbabbbbabaabbaaaababbbbbbaaabab aababaaabbabbbbbbabaabbabbbabbabaabbabbbbabaabbaababaaaaababaababaabbbbbaaaababbbabbaababbbbaabababb aababbbbabaabbbbababbaaabbbababaabababbbbaaaaaaaaabababbbbabbbabbbbbaaabaaaaabbbabaabbabbbaababaaaba bbaabaaabbbabaaabbabaabbaaababaaaaaabbaaababaaabaaaaababbbaaaababaaabbbaaaabbbbbaaabaababbababababab aaabbbbbbbbbaaaabbbbaabaaaabbbababbabababbabaaaabababbabaabbaaaababbababaababbaaababbbbabbbbbbbaaabb aabbaabaaabbaabbbabaaaabbbbbbabbabbaaaabbabbbabbbbaabaabbbabaaaabbbabaaaaaabaabbaaaaabaabbbaaabbabba aaaaaaaaaabababbbabbbaabbaabbbaaaaabbbbbbaabbbaaaabababbaabbbabaabbbbaabbbaabbaabbbaabababababbabbab bbbbbbabaabaaaaabbbabababbbbaabbabbaabaaabbbaaababbaabaaaabaabbaabbaababbbabaabbaabaabaabbaababaabab abbabaaabbabbababbaabbaababbabbaaaaaaabaaaaabbbabababbbababbbbaababbababbbabbbbbaabbaababababaaaaaaa bbaaabbaabbbbaabbbbbbabbaaaabbbbaababbbabbbabbaabbbbbbabaabaabaaaaabaababbabbbababbababbbbabbbbbbabb bababbbbaabaaababbaaabaabaabababaaaaaaaaabbaababababbabaaaabaabababbbaabaaabababbbbaabababbabababaab abbbbbbabbbbbbaababaabbaaaabaaaaaabbbaaabaaabaabaabbbbaabbabbababaabbbaaaababababbbbbabaabbaaaabaaab bbaababbbabaaabbbabbabababaaabaaaaaabaabbbbaaaababbbbbababababbabbbbaaabaabaabaababbabbabbbabaaabbaa aabaabababbaabbababaaababaaabbbbabababaabbabaabbbaabaabbabbbabaabaabbbbababaababaabbaabbaaaabaaabaaa baabbbabbabbbabaaaaaaaaabbbbbbaaaaaaabbbaaababaabaaaabbbbbbbbbbabbaabbaaaaaabbbabaababaaaaababbbbaab aabbaaabaabbaaaaababaabbbaabbaabaaabaababbabbbabababbbaabbbbabbaabbbbbabbabaabbababbaaabababaaaaaaba bbaaabbabaaabbbababbabbbbbbbabbaaaaabababbbaabaaaaababaaaabbaababababaabababbaabbabbbababbabbaababba.

//GIves correct output when run customly but fails to submit