#include <iostream>
using namespace std;
const int MAXN=10000;
const int M=9001;
int Hash[MAXN];

class AddressList{
    
public:
        AddressList()
{ memset(Hash,-1,sizeof(Hash));}
        
~AddressList(){}
        unsigned ELFHash(
const char *str){
            unsigned Key
=0,x=0;
            
while(*str)
           
{
                Key
=(Key<<4 )+(*str++); //Key值左移4位加上一個字符
                if((x=Key&0xF0000000L)!=0)//判斷Key值的高4位是否不為0,因為不為0時需要下面特殊處理,否則上面一步的左移4位會把這高四位給移走,造成信息丟失
               {
                   Key
^=(x>>24);   //把剛才的高4位跟Key的低5-8位異或
                   Key&=~x;            //把高4位清0
                }

            }

            
return  (Key & 0x7FFFFFFF); //另Key值是一個非負數
         }

         
void Search(const char *str){
             
int Key=ELFHash(str);
             
int t=Key%M;
             
while(Hash[t]!=Key&&Hash[t]!=-1)
                 t
=(t+5)%M;
             
if(Hash[t]==-1)
                 Hash[t]
=Key;
             
else
                 cout
<<str<<"'s AddressList is recorded."<<endl;
          }

}
;

int main(){
    AddressList AL;
    
char str[MAXN];
    
int nCase;
    cout
<<"You want input (n?) AddressList."<<endl;
    freopen(
"in.cpp","r",stdin);
    
while(scanf("%d",&nCase)!=EOF)
        
for(gets(str);nCase>0;nCase--)
        
{
            gets(str);
            AL.Search(str);
        }

    
return 0;
}