Bob is working as a data scientist, which basically means he stares at big integers all day. Bob loves big integers, and loves making them as big as possible. He is currently staring at an integer consisting of non-zero digits, and wants to make it bigger. However, since he doesn't want to mess up the database too much and potentially get fired, he limits himself to swapping at most one pair of adjacent digits of the integer. What is the biggest integer he can create by doing so?
Constraints
All digits of are non-zero.
Subtask 1 [2/15]
Subtask 2 [6/15]
Subtask 3 [7/15]
No additional constraints.
Input Specification
The first line contains an integer .
The second line contains a -digit integer .
Output Specification
Output the largest integer Bob can create by swapping at most one pair of adjacent digits of .
Sample Input 1
20
32249178991231416774
Sample Output 1
32429178991231416774
Sample Input 2
5
54321
Sample Output 2
54321
Comments