#include using namespace std; int main(){ char str[101]; cin >> str; int ite = 0; int east = 0; int west = 0; while (1) { if (str[ite] == '\0') break; char c = str[ite]; 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; } ite++; } cout << "NA" << endl; return 0; }