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