#include #include #include #include #include #include #include using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int T; cin >> T; for(int _ = 0; _ < T; _++){ int N; string S; cin >> N >> S; bool ok = false; for(int i = 0; i+2 < N; i++){ if(S[i] == 'o' && S[i+1] == 'o' && S[i+2] == '-') ok = true; if(S[i] == '-' && S[i+1] == 'o' && S[i+2] == 'o') ok = true; if(S[i] == 'o' && S[i+1] == '-' && S[i+2] == 'o') ok = true; if(S[i] == 'o' && S[i+1] == 'o' && S[i+2] == 'o') ok = true; } for(int i = 0; i+3 < N; i++){ if(S[i] == '-' && S[i+1] == 'o' && S[i+2] == '-' && S[i+2] == '-') ok = true; if(S[i] == '-' && S[i+1] == '-' && S[i+2] == 'o' && S[i+2] == '-') ok = true; } if(ok) cout << 'O' << endl; else cout << 'X' << endl; } }