#include using namespace std; int main() { string S; cin >> S; int w = 0, e = 0; for (int i = 0; i < S.size(); i++) { if (S.at(i) == 'X') w++; else e++; if (w == 3) { cout << "West" << "\n"; return 0; } if (e == 3) { cout << "East" << "\n"; return 0; } } cout << "NA" << "\n"; }