#include<stdio.h>
#include<stdio.h> 
struct Node{
    char data;
    struct Node *left,*right;
};
struct Node* newNode(char data){
    struct Node* node=(struct Node*)malloc(sizeof(struct Node));
    node->data=data;
    node->left=node->right=NULL;
    return node;
}
struct Node* insert(struct Node* root,char data){
    if(root==NULL)
       return newNode(data);
    if(data < root->data)
       root->left=insert(root->left,data);
    else if(data >root->data)
       root->right=insert(root->right,data);
    return root;
}
void inorder(struct Node* root){
    if(root!=NULL){
        inorder(root->left);
        printf(root->left);
        inorder(root->right);
    }
}
int main(){
    int n;
    scanf("%d",&n);
    if(n <= 0){
        printf("Invalid input");
        return 0;
    }
    struct Node* root=NULL;
    char  ch;
    for(int i=0;i<n;i++){
        scanf("%c",&ch);
    }
        root=insert(root,ch);
}
       inorder(root);
       return 0;
}