#include <bits/stdc++.h>
#include<vector>

using namespace std;

void swaping(string& s, int i, int j){
    char temp = s[i];
    s[i] = s[j];
    s[j] = temp;
}

void fun(string& s, int n){
    int maxx = -1, maxi;
    int l = -1, r;
    for(int i = 2 * n - 2; i >= 0; i-=2){
        if(((int)s[i] - 48) > maxx){
            maxx = ((int)s[i] - 48);
            maxi = i;
        }else{
            if(((int)s[i] - 48) < maxx){
                l = i;
                r = maxi;
            }
        }
    }
    if(l == -1){
        swaping(s, 2 * n - 4, 2 * n - 2);
    }else{
        swaping(s, r, l);
    }
}

int main(void)
{
    ios_base::sync_with_stdio(false);
    int n;
    scanf("%d", &n);
    string s;
    cin >> s;

    if(n == 2){
        swaping(s, 0, 2);
    }else{
        fun(s, n);
    }
    cout << s;
}