#include #include using namespace std; int main() { string s; cin >> s; int east = 0; int west = 0; for (char c : s) { if (c == 'O') { ++east; west = 0; } else { ++west; east = 0; } if (east == 3) { cout << "East" << endl; return 0; } if (west == 3) { cout << "West" << endl; return 0; } } cout << "NA" << endl; }