for s in open(0):exec("s=str(hash(s[9::11]+'dn')%3)+s;"*10);print(s[:10])