#include #include using namespace std; string s[6] = {"--o-","-o--","oo-","o-o","-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; } int main(){ int i,t; cin >> t; while(t){ t--; int n; string st; cin >> n >> st; for(i=0;i<6;i++){ if(ch(st,s[i])){ cout << "O" << endl; break; } if(i==5){ cout << "X" << endl; } } } }