#include #include using namespace std; string s[5] = {"--o-","-o--","oo-","-oo","ooo"}; bool ch(string st,string u){ int i,j,n = st.size(),k = u.size(); for(i=0;i=n || st[i + j]!=u[j]) break; if(j==k - 1) return true; } } return false; } bool ch2(string st){ int i,n = st.size(); int l = -1; bool flag = false; for(i=1;i> t; while(t){ t--; int n; string st; cin >> n >> st; for(i=0;i<5;i++){ if(ch(st,s[i])){ cout << "O" << endl; break; } if(i==4){ if(ch2(st)) cout << "O" << endl; else cout << "X" << endl; } } } }