#include #define rep(i,n) for (int i=0; i<(n); ++i) using namespace std; using ll = long long; string solve(int N, string S) { for (int i=0; i= 3 && __builtin_popcount(hy+1) == 1 && 0 <= i-hy && S[i-hy] == 'o' && i+1 < N && S[i+1] == 'o') { return "O"; } } return "X"; } int main() { int T; cin >> T; while (T--) { int N; string S; cin >> N >> S; cout << solve(N, S) << endl; } return 0; }