Some error occured while loading page for you. Please try again.
Lexicographical order is often known as alphabetical order when dealing with strings. A string is greater than another string if it comes later in a lexicographically sorted list.
Given a word, create a new word by swapping some or all of its characters. This new word must meet two criteria:
Complete the function biggerIsGreater below to create and return the new string meeting the criteria. If it is not possible, return no answer.
The first line of input contains , the number of test cases.
Each of the next lines contains .
For each test case, output the string meeting the criteria. If no answer exists, print no answer.
Sample Input 0
Sample Output 0