S = input() print('East' if '000' in S else 'West' if 'XXX' in S else 'NA')