#include <iostream>
using namespace std;
template <class Type>
int bisearch(Type a[],const Type& x,int low,int high);
int main()
{
string x[10],y;
int n,i;
cout<<"Input the num:";
cin>>n;
printf("input %d sorted elements:",n);
for(i=0;i<n;i++) cin>>x[i];
cout<<"Input the element to search:";
cin>>y;
cout<<bisearch(x,y,0,n-1)<<endl;
return 0;
}
template <class Type>
int bisearch(Type a[],const Type& x,int low,int high){
if(low>high) return -1;
int mid=(low+high)/2;
if(x==a[mid]) return mid;
else if(x>a[mid])return bisearch(a,x,mid+1,high);
else return bisearch(a,x,low,mid-1);
}