#include #include void solve() { int n; std::cin >> n; int len = 0, c1 = -1, c2 = -1; bool ans = false; while (n--) { char c; std::cin >> c; if (c == 'x') { len = 0; c1 = c2 = -1; } else { ++len; int c0 = (c == 'o'); if ((c1 == 1 && c2 == 1) || (c0 == 1 && c2 == 1) || (c0 == 1 && c1 == 1 && c2 != -1)) { ans = true; } if (c2 == 1) { c0 = 1; c1 = -1; } c2 = c1; c1 = c0; } } 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; }