#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; constexpr int inf=1e9+7; constexpr ll longinf=1LL<<60 ; constexpr ll mod=1e9+7 ; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t; cin>>t; while(t--){ int n; cin>>n; string s; cin>>s; bool win=false; rep(i,n-2){ if(s[i]=='o'&&s[i+1]=='o'&&s[i+2]=='o')win=true; if(s[i]=='o'&&s[i+1]=='o'&&s[i+2]=='-')win=true; if(s[i]=='o'&&s[i+1]=='-'&&s[i+2]=='o')win=true; if(s[i]=='-'&&s[i+1]=='o'&&s[i+2]=='o')win=true; } rep(i,n-3){ if(s[i]=='-'&&s[i+1]=='-'&&s[i+2]=='o'&&s[i+3]=='-')win=true; if(s[i]=='-'&&s[i+1]=='o'&&s[i+2]=='-'&&s[i+3]=='-')win=true; } rep(i,n-4){ if(s[i]=='o'&&s[i+1]=='-'&&s[i+2]=='-'&&s[i+3]=='-'&&s[i+4]=='o')win=true; } if(win)cout<<"O"<