#include<stdio.h>
#include<stdlib.h>
struct Node {
    int key;
    struct Node * left, * right;
};
struct Node* newNode(int key){
    struct Node*temp = (struct Node*)malloc(sizeof(struct Node));
    temp->key = key;
    temp->left =temp->right = NULL;
    return temp;
}
struct Node* insert(struct Node* root, int key){
    if(root == NULL)
    return newNode(key);
    if (key < root ->key)
    root->left = insert(root->left,key);
    else if(key > root->key)
    root->right = insert(root->right,key);
    return root;
}
void inorder(struct Node*root){
    if(root !=NULL){
        inorder(root->left);
        printf("%d/n",root->key);
        inorder(root->right);
    }
}
int main(){
    int n;
    scanf("%d",&n);
    if(n<0 || n>10){
        printf("Invalid input");
        return 0;
    }
    if(n==0){
        printf("Tree is Empty");
        return 0;
}
struct Node* root =NULL;
for (int i =0;i < n; i++){
    int key;
    scanf("%d",&key);
    if(key < -100 || key >100){
        print("Invalid input");
        return 0;
    }
    root = insert(root,key);
}
inorder(root);
return 0;