#include #define rep(i,n) for (int i = 0; i < (n); i ++) using namespace std; typedef long long ll; typedef pair P; typedef pair PL; const ll MOD = 1e9 + 7; const ll INF = 1e10; const vector dy = {-1,0,1,0}; const vector dx = {0,1,0,-1}; int main() { int t; cin >> t; rep(_,t) { int n; string s; cin >> n >> s; char ans = 'X'; rep(i,n - 1) { if (s[i] == 'o' && s[i + 1] == 'o') { if (i == 0 || i == n - 2) continue; if (s[i - 1] == 'x' && s[i + 2] == 'x') continue; else {ans = 'O'; break;} } } cout << ans << endl; } }