#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; auto solve() { string s, ans = "NA"; cin >> s; size_t e = s.find("OOO"); size_t w = s.find("XXX"); if (e < w) ans = "East"; if (e > w) ans = "West"; return ans; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout << solve() << endl; getchar(); }