#include using namespace std; int main() { char a[100]; bool b = false; for (int i = 0; i < 100; i++) { cin >> a[i]; if (a[i] != 'O'&&a[i] != 'X')break; } for (int i = 0; i < 100; i++) { if (a[i] == 'O') { if (a[i + 1] == 'O'&&a[i + 2] == 'O') { cout << "East" << endl; b = true; break; } } if (a[i] == 'X') { if (a[i + 1] == 'X'&&a[i + 2] == 'X') { cout << "West" << endl; b = true; break; } } } if (b == false)cout << "NA" << endl; system("pause"); return 0; }