#include #include #include using namespace std; #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair typedef long long ll; typedef pair pii; typedef pair pll; typedef long double ld; const ll inf=1e9+7; const ll mod=998244353; int main(){ ll t;cin>>t; while(t){ t--; ll n;string s;cin>>n>>s; string a="xxxx"; string b=""; b+=a+s+a; bool f=0; rep(i,n){ ll c=i+4; if(b[c]=='o'&&b[c+1]=='-'&&b[c+2]=='o')f=1; if(b[c]=='o'&&b[c+1]=='o'&&b[c+2]=='-')f=1; if(b[c]=='-'&&b[c+1]=='o'&&b[c+2]=='o')f=1; if(b[c]=='o'&&b[c+1]=='o'&&b[c+2]=='o')f=1; if(b[c]=='o'&&b[c+1]=='-'&&b[c+2]=='o'&&b[c+3]=='-'&&b[c+4]=='o')f=1; if(b[c]=='-'&&b[c+1]=='o'&&b[c+2]=='-'&&b[c+3]=='-')f=1; if(b[c]=='-'&&b[c+1]=='-'&&b[c+2]=='o'&&b[c+3]=='-')f=1; if(b[c]=='o'&&b[c+1]=='-'&&b[c+2]=='-'&&b[c+3]=='-'&&b[c+4]=='o')f=1; } if(f)cout<<'O'<