#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node* left;
    
    struct node* right;
};
struct node* create(int data){
    struct node* newnode=(struct node*)malloc(sizeof(struct node));
    if(!newnode){
        printf("Invalid input");
        exit(1);
    }
    newnode->data= data;
    newnode->left= newnode->right = NULL;
    return newnode;
}
struct node* insert(struct node* root, int x){
    if(root==NULL){
        return create(x);
    }
    if(x <root->data){
        root->left= insert(root->left,x);
    }
    else if(x >root->data){
        root->right= insert(root->right,x);
        
    }
    return root;
}
    
    int search(struct node* root, int key){
        if(root==NULL){
            return 0;
        }
        if(key== root->data){
            return 1;
        }
        else if(key < root->data){
            return search(root->left, key);
        }
        else
        return search(root->right, key);
    }
}
int main(){
    int n,value, key;
if(scanf("%d",&n)!= 1 || n<=0)
{
        printf("Invalid input");
        return 0;
    }
    struct node* root=NULL;
    for(int i=0; i<n; i++){
        if(scanf("%d",&value)!=1){
            printf("Invalid input");
            return 0;
        }
        root = insert(root,value);
    }
    
    if(scanf("%d", &key)!=1){
    
        printf("Invalid input");
        return 0;
    }
    if(search(root,key){
        printf("found");
}else{
    printf("not found");
}
return 0;
}