#include using namespace std; typedef long long ll; int main() { string s; cin >> s; int o = 0; int x = 0; for (char c : s) { if (c == 'O') { o++; if (o == 3) { puts("EAST"); return 0; } x = 0; } else { x++; if (x == 3) { puts("WEST"); return 0; } o = 0; } } puts("NA"); return 0; }