#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define range(a) a.begin(), a.end() int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); int T; cin >> T; while (T--) { int N; cin >> N; string S; cin >> S; S = "xxxxx" + S + "xxxxx"; N = S.size(); bool ans = false; ans |= S.find("ooo") != string::npos; ans |= S.find("o-o") != string::npos; ans |= S.find("oo-") != string::npos; ans |= S.find("-oo") != string::npos; ans |= S.find("o---o") != string::npos; cout << (ans ? "O" : "X") << '\n'; } }