#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    char ch;
    struct node *right,*left;
}Node;

Node *root=NULL;

Node *create (char ch){
    Node *newnode=(Node*)mallloc(1*sizeof(Node));
    newnode->data=data;
    newnode->right=NULL;
    newnode->left=NULL;
}Node;

Node *insert(Node *root,char data){
    if(root == NULL)
        return  craete(data);
    if(ch<root->data)
        root->left=insert(root->left,ch);
    if(ch>root->data)
        root->right=insert(root->right,ch);
    return root;
}

Node* inorder(char ch){
    if(ch != NULL){
        inorder(root->left);
        printf("%c",ch);
        inorder(root->right);
    }
}

int main(){
    char chh;
    int size;
    scanf("%d",&size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    for(int itr=1;itr<size;itr++){
        scanf("%c",chh);
        root=insert(root,ch);
    }
    inorder(ch);
    return 0;
}