#include #include #include #include #include #include #include #include #define AS(a) (sizeof(a)/sizeof(a[0])) using namespace std; long long int MOD = 1000000007; long long int INF = 1000000007; int main() { string a; cin >> a; for(int i = 0; i < (int)a.length()-2; i++) { if(a[i] == 'O' && a[i+1] == 'O' && a[i+2] == 'O') { cout << "Eest" << endl; return 0; } else if(a[i] == 'X' && a[i+1] == 'X' && a[i+2] == 'X') { cout << "West" << endl; return 0; } } cout << "NA" << endl; }