#include using namespace std; typedef long long ll; typedef pair pii; #define pb push_back #define mp make_pair #define rep(i,n) for(int i=0;i<(n);++i) int main(){ cin.tie(0); ios::sync_with_stdio(false); string s;cin >> s; int cnt=0; char c=s.at(0); rep(i,s.size()){ if(s.at(i)==c) cnt++; else{ c=s.at(i); cnt=1; } if(cnt==3){ if(c=='O') cout << "East" << endl; else cout << "West" << endl; return 0; } } cout << "NA" << endl; }