#include<bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node *next;
struct node *prior;
};
struct node *head;
void extend(struct node *head,int value){
struct node *p=head;
while(p->next!=NULL){
p=p->next;
}
cout<<"end"<<p->data<<endl;
struct node *nn=new node;
nn->data=value;
nn->next=NULL;
p->next=nn;
cout<<"extend"<<p->next->data<<endl;
}
void insertfront(struct node *h,int value){
struct node *t=new node;
t->data=value;
t->next=h;
head =t;
}
bool find(struct node *h,int value){
while(h!=NULL){
if(h->data==value){
return true;
}
h=h->next;
}
return false;
}
void deleteNode(struct node *h,int value){
struct node *t=h;
while(h->data!=value){
t=h;
h=h->next;
}
t->next=h->next;
}
void insertNode(struct node *h,int value,int insertValue){
struct node * tt=new node;
tt->data=insertValue;
while(h->data!=value){
h=h->next;
}
tt->next=h->next;
h->next=tt;
}
void show(struct node *h){
while(h!=NULL){
cout<<h->data<<" ";
h=h->next;
}
cout<<endl;
}
int main(int argc, char** argv) {
freopen("abc.txt","r",stdin);
int n;
cin>>n;
head=new node();
head->next=NULL;
struct node *p1;
struct node *p2;
for(int i=0;i<n;i++){
if(i==0){
int t;
cin>>head->data;
p1=head;
p2=head;
}else{
p1=new node();
cin>>p1->data;
p1->next=NULL;
p2->next=p1;
p2=p1;
}
}
//extend(head,12);
//extend(head,13);
//insertfront(head,3);
//deleteNode(head,8);
insertNode(head,2,99);
show(head);
int x=4;
if(find(head,x)){
cout<<x<<" find"<<endl;
}else{
cout<<x<<" not find"<<endl;
}
return 0;
}