#include <iostream>
using namespace std;
int main()
{
int n, list[15],num,hash,i;
for(i = 0; i < 15; i++)
list[i] = -999;
cin>>n;
while(n--)
{
cin>>num;
hash = num % 11;
while(list[hash] != -999)
{
hash = (hash + 1)%15;
}
list[hash] = num;
}
n = 0;
cout<<list[0];
for(i = 1; i < 15; i++)
cout<<" "<<list[i];
cout<<endl;
cin>>num;
hash = num % 11;
while(list[hash] != -999)
{
if(list[hash] != num)
{
n ++;
hash = (hash + 1) % 15;
}
else
{
n ++;
cout<<"查找成功 "<<n<<endl;
break;
}
}
if(list[hash] == -999)
{
list[hash] = num;
cout<<"插入成功 "<<hash<<endl;
}
return 0;
}