#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){return(A>B?A=B,1:0);} templateinline bool chmax(T&A,S B){return(A>S; int x=S.find("OOO"); int y=S.find("XXX"); if(x==-1)x=1e9; if(y==-1)y=1e9; cout<<(xy?"West":"NA")<<"\n"; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout<>T; while(T--)sol(); }