#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; void solve(){ int N; cin >> N; string S; cin >> S; if(N<=2){ cout << "X\n"; return ; } int l = 0; bool ok = false; while(l=3) ok = true; if(S[l]=='-'){ if(l>=2 && S[l-1]=='o' && S[l-2]=='o') ok = true; if(r+1=1 && r=5 && len%2) ok = true; } } l = r; } cout << (ok? "O\n":"X\n"); } int main(){ cin.tie(0); ios::sync_with_stdio(false); int T; cin >> T; while(T--){ solve(); } }