Company: Nokia_14june
Difficulty: medium
You are given a string s consisting of lowercase English letters. You must perform exactly one reversal operation on the string. In this operation you choose a positive integer k (1 ≤ k ≤ |s|) and then either: reverse the first k characters of the string, or reverse the last k characters of the string. Your goal is to determine the lexicographically smallest string that can be achieved after performing exactly one such reversal operation. Note that choosing k = 1 reverses a single character and therefore leaves the string unchanged, so the original string is always one of the reachable results. A string a is lexicographically smaller than string b if at the first position where they differ, string a has a character that appears earlier in the alphabet than the corresponding character in b , or if a is a prefix of b . Input Format A single line containing the string s . Output Format Print a single line containing the lexicographically smallest string obtainable after performing e