#include<stdio.h>
#include<stdlib.h>

typedef struct Tree{
    char data;
    struct Tree *left,*right;
}tree;

tree *root=NULL;
tree *bran;

tree *create(char ch){
    bran=(tree*)malloc(1 * sizeof(tree));
    bran->data=ch;
    bran->left=NULL;
    bran->right=NULL;
    return bran;
}

tree *insert(tree *root,char ch){
    if(root == NULL){
        return create(ch);
    }
    if(root->data>ch){
        root->left=insert(root->left,ch);
        
    }
    else if(root->data<ch){
        root->right=insert(root->right,ch);
    }
    return root;
}

void inorder(tree *root){
    if(root!=NULL){
        inorder(root->left);
        printf("%c",root->data);
        inorder(root->right);
    }
}

int main(){
    int size;
    char ch;
    int ind;
    scanf("%d",&size);
    getch();
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    getch();
    for(ind=0;ind<size;ind++){
        scanf("%c",ch);
        if(ch==' '){
            continue;
        }
        root=insert(root,ch);
    }
    inorder(root);
    return 0;
}