while 1:s=raw_input();print' '.join(x+y for x in'abcdefgh'for y in'12345678'if~int(x+y+s,24)**4%577^4<4)