#include using namespace std; int main(){ int t;cin>>t; while(t--){ int n;string s;cin>>n>>s; int z = 0; for(int i = 0; n > i; i++){ if(s[i]=='o'){ if(n!=i+1 && s[i+1]=='o'){ if((i&&s[i-1]!='x')||(n!=i+2&&s[i+2]!='x')){ //cout << i << 1 << endl; cout << "O" << endl; z++; break; } }else if(n!=i+2 && s[i+2]=='o' && s[i+1]=='-'){ //cout << i << 2 << endl; cout << "O" << endl; z++; break; }else if(i&&s[i-1]!='x'&&n!=i+1 && s[i+1]!='x'){ //cout << i << 3 << endl; cout << "O" << endl; z++; break; } } } if(!z){ cout << "X" << endl; } } }