#include #include void solve() { int n; std::string s; std::cin >> n >> s; auto judge = [&]() -> bool { for (int i = 0; i < n; ++i) { if (s.substr(i, 3) == "ooo" || s.substr(i, 4) == "-oo-") { return true; } } return false; }; bool ans = judge(); for (int i = 0; i < n; ++i) { if (s[i] != '-') continue; s[i] = 'o'; if (judge()) ans = true; s[i] = '-'; } std::cout << (ans ? 'O' : 'X') << std::endl; } int main() { std::cin.tie(nullptr); std::cout.tie(nullptr); std::ios::sync_with_stdio(false); int q; std::cin >> q; while (q--) solve(); return 0; }