s=input() c_e=0 c_w=0 for i in range(len(s)-2): if s[i]=='o' and s[i+1]=='o' and s[i+2]=='o': c_e+=1 break elif s[i]!='o' and s[i+1]!='o' and s[i+2]!='o': c_w+=1 break if c_e==1: print('East') elif c_w==1: print('West') else: print('NA')