#include #include #include bool g(std::string const& s, std::string const& t) { return (std::search(s.begin(), s.end(), t.begin(), t.end()) != s.end()); } char f(std::string const& s) { if (g(s, "-o--")) return true; if (g(s, "--o-")) return true; if (g(s, "-oo")) return true; if (g(s, "o-o")) return true; if (g(s, "oo-")) return true; if (g(s, "ooo")) return true; return false; } int main() { int t; scanf("%d", &t); while (t--) { size_t n; char buf[1024]; scanf("%zu %s", &n, buf); std::string s = buf; puts(f(s)? "O": "X"); } }