#include using namespace std; int main(){ int T; cin >> T; vector cases = {"-oo", "oo-", "ooo", "o---o", "o-o", "-o--", "--o-"}; for (int t = 0; t < T; t++){ int n; string S; cin >> n >> S; bool flag = false; for (const auto &c: cases){ flag |= S.find(c) != string::npos; } puts(flag ? "O" : "X"); } }