a='' for c in open(0).read():a=c[c<'A':print(end=((c+c+str(a.find(c)))*2)[5])]+a