#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int t; cin >> t; for (int i = 0; i < t; i++) { int n; string s; cin >> n >> s; bool flag = false; for (int j = 0; j < n; j++) { string a, b, c; if (n - j >= 3) { a = s.substr(j, 3); if (a == "ooo" || a == "-oo" || a == "o-o" || a == "oo-") { cout << "O\n"; flag = true; break; } } if (n - j >= 4) { b = s.substr(j, 4); if (b == "--o-" || b == "-o--") { cout << "O\n"; flag = true; break; } } if (n - j >= 5) { c = s.substr(j, 5); if (c == "--o--") { cout << "O\n"; flag = true; break; } } } if (!flag) cout << "X\n"; } }