s=input() print('East' if 'OOO' in s else 'West' if 'XXX' in s else 'NA')