//3連勝 #include #include using namespace std; int east = 0, west = 0; int main() { char input[100] = {}; int i = 0; cin >>input; while (i<100) { if (input[i] == 'O') {west = 0; east++;} else if (input[i] == 'X') {west++; east = 0;} else if (input[i] == EOF) break; if (west == 3) {cout <<"West\n"; return 0;} else if (east == 3) {cout << "East\n"; return 0;} i++; } cout << "NA" << endl; return 0; }