#include #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using namespace std; int main() { int T; cin >> T; rep(i, T) { int N; string S; cin >> N >> S; if (N <= 2) { cout << "X" << endl; continue; } bool flag = false; rep(i, N - 2) { string s = ""; s += S[i]; s += S[i + 1]; s += S[i + 2]; // cout << s << endl; if(s == "ooo" || s=="oo-" || s=="o-o" || s=="-oo"){ flag = true; break; } } cout << (flag?"O":"X") << endl; } }