#include<bits/stdc++.h>
using namespace std;
#define nil -99999999;
struct node
{
int key;
node* left;
node* right;
node()
{
key=nil;
left=NULL;
right=NULL;
}
};
node Node[100009];
int Tree_size=1;
void Insert(int k)
{
node now=T[1];
if(now.key==nil) //树为空
{
T[1].key=k;
}
else
{
node last;
while(now.key!=nil)
{
last=now;
if(k<now.key)
{
now=*(now.left);
}
else
{
now=*(now.right);
}
}
node New;
New.key=k;
Node[Tree_size+1]=New;
if(last.key<k)Node[last].left=&Node[Tree_size+1];
else
Node[last].right=&Node[Tree_size+1];
Tree_size++;
}
}
node Search(int k)
{
node now=T[1];
while(now.key!=nil)
{
if(now.key==k)return now;
if(now.k<k)
{
if(now.left==NULL)return T[Tree_size+10];
now=*(now.left);
}
else
{
if(now.right==NULL)return T[Tree_size+10];
now=*(now.right);
}
}
return now;
}