#include using namespace std; #define ll long long #define all(x) x.begin(),x.end() #define ar array #define sz(x) ((int)x.size()) template inline bool chmin(T &a,const S &b) {return (a> b? a= b, 1: 0);} template inline bool chmax(T &a,const S &b) {return (a< b? a= b, 1: 0);} int main(){ ios_base::sync_with_stdio(false),cin.tie(0); int t; cin >> t; while(t--){ int n; string s; cin >> n >> s; // o-o // ooo // oo- // -oo //-o-- -oo- xoo- // --o- vector arr; arr.push_back("o-o"); arr.push_back("ooo"); arr.push_back("oo-"); arr.push_back("-oo"); arr.push_back("-o--"); arr.push_back("--o-"); bool ok = false; for(auto ele: arr) if(s.find(ele) != s.npos) ok = true; cout << (ok ? "O" : "X") << "\n"; } return 0; }