import re,random
c=random.choice
d={}
print "Hi!"
i=raw_input()
r=re.sub
d["HI"]=i
l=["HI",r('\W+','',i).upper()] #list of responses
print i
while True:
j=raw_input()
if j=="break":break
try:d[l[len(l)-1]]+=[j]
except:d[l[len(l)-1]]=[j]
try:print c(d[j]);l+=[r('\W+','',d[j]).upper()]
except:print d[c(d.keys())];l+=[r('\W+','',d[c(d.keys())])]
print l,d