// editor2
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int data;
struct node *left;
struct node *right;
}node;
node *root= NULL;
/////////create///////////
struct node* create(int val){
    struct node *newnode=(node*)malloc(sizeof(node));
    newnode->data = val;
    newnode->left = NULL;
    newnode->right= NULL;
    return newnode;
}
 struct node* insert(node root,int val){
        if(root == NULL)
        return create(val);
        if(val <root->data){
            root->left=insert(root->left,val);
        }
        else
            root->right=insert(root->right,val);
            return root;
////build//////
void buildtree(int arr[], int n,int i){
    if(root == NULL)
    return ;
    node *root = create(arr[i]);
    root->left=buildtree(arr,size,2*i+1);
    root->right=buildtree(arr,size,2*i+2);
    return root;
}
int main(){
    int size;
    scanf("%d",&size);
    node *root =NULL;
    for (int i=0;i<size;i++){
        int h;
        scanf("%d"&h);
        root =insert(root,val);
    }
    
    
    void inorder(int node *root){
        if(root == NULL)
        return;
        inorder(root->left);
        printf("%d",root->data);
        inorder(root->right);
    }
}