#include<stdio.h>
#include<stdlib.h>
typedef struct tree{
int data;
struct tree *left;
struct tree *right;
}node;
int main(){
    node*create(int val){
        node* newnode=(node*)malloc(sizeof(node));
        newnode->data=val;
        newnode->left=newnode->right=NULL;
        return newnode;
    }
    node *insertBST(node* node,int val){
        if(root=NULL){
            root=newnode;
        }
        if(val>root->data){
            root->right=insertBST(root->right,val);
            
    }
    else{
        root->left=insertBST(root->left,val);
    }
    }
    int n;
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    scanf("%d",&n);
    node *root=NULL;
    int h;
    for(int i=0;i<n;i++){
        scanf("%d",&h);
        if(h<0){
            printf("Invalid input");
            return 0;
        }
        create(h)
    }
}