west=0 east=0 pre='' for i in input(): if i=='O': east+=1 west=0 else: east=0 west+=1 if east==3: print('East') break elif west==3: print('West') break else: print('NA')