Codeforces problem a div 2 creating character

can anyone who is solving this problem tell me whats wrong with my approach