for(;x=readline();)print('ahgfedcb'[7&x.charCodeAt()]+(9-x[1]))