// editor1
#include<stdio.h>
#include<stdlib.h>
typedef struct treenode{
    int data;
    struct treenode *right;
    struct treenode *left;
}node;
node *root=NULL;
ode *create(int num){
    node *newnode=(node*)mallo(sizeof(node));
    newnode->data=num;
    newnode->left=newnode->right=NULL;
    return newnode;
}
node *insert(node *root,int num){
    if(root==NULL)
    return create(num);
    if(num<root->data);
    root->left=insert(root->left,num);
    return root;
    else
    root->right=insert(root->right,num);
    return root;
}
void sortorder(node *root){
    if(root !== NULL){
        sortorder(root->left);
        printf("%d",root->data);
        sortorder(root->right);
    }
}
int main(){
    int n,size;
    scanf("%d",&size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    for (int i=0;i<size;i++){
        scanf("%d",&num);
        root=insert(root,num);
    }
    sortorder(root);
    return 0;
}
}