Mike Ann sit classroom the lesson boring decide play interesting game fortunately need play game string s number k 0 le k sAt beginning game player give substre s leave border l right border r equal k ie initially lrk then player start move accord follow rule a player choose lprime rprime lprime le l rprime ge r slprime rprime lexicographically sl r then player change l r way l lprime r rprime Ann move the player can not losesrecall substring sl r l le r string s continuous segment letter s starts position l end position r for example ehn substre s3 5 aaaehnsvz ahz notMike Ann play enthusiastically notice teacher approach surprisingly teacher do not scold instead say figure winner game start know s kUnfortunately Mike Ann keen game theory ask write program take s determine winner possible k