r=range(-2,3) while 1:a,b=raw_input();print" ".join([chr(i)+`j`for(i,j)in[(x+ord(a),y+int(b))for x in r for y in r if abs(x*y)==2]if 0