#K55832. Lexicographically Smallest String
Lexicographically Smallest String
Lexicographically Smallest String
Given an integer \( n \) and a string \( s \) of length \( n \) containing only lowercase Latin letters, your task is to generate the lexicographically smallest string possible by swapping any two distinct characters. In other words, by rearranging the characters, you must determine the minimal string in lexicographical order.
This problem can be formulated as follows: find \( s_{min} \) such that \( s_{min} = \min \{ \text{any permutation of } s \} \), where the only allowed operation is swapping two distinct characters. For example, if \( s = "dbca" \), the lexicographically smallest string that can be obtained is \( "abcd" \).
inputFormat
The input consists of two lines. The first line contains an integer \( n \) representing the length of the string. The second line contains a string \( s \) consisting of lowercase Latin letters.
outputFormat
Output a single line containing the lexicographically smallest string that can be obtained by swapping any two distinct characters in \( s \).
## sample4
dbca
abcd