you give string s you need find nonempty string b follow condition satisfy Strings b subsequence s for index character s_i string s belong exactly string b String lexicographically minimum possible string b possible string give stre s print valid bReminderA string b subsequence string s b obtain s deletion possibly zero element for example dore cf subsequence codeforce decor fork nota string x lexicographically small string y follow hold x prefix y x ne y position x y differ string x letter appear early alphabet corresponding letter y