use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let t: usize = itr.next().unwrap().parse().unwrap(); let mut out = Vec::new(); for _ in 0..t { let n: usize = itr.next().unwrap().parse().unwrap(); let s: Vec = itr.next().unwrap().chars().collect(); let mut o = false; if n > 2 { for i in 0..n - 2 { if s[i] == 'o' && s[i + 1] == 'o' && s[i + 2] != 'x' { o = true; } if s[i] != 'x' && s[i + 1] == 'o' && s[i + 2] == 'o' { o = true; } if s[i] == 'o' && s[i + 1] != 'x' && s[i + 2] == 'o' { o = true; } if i < n - 3 { if s[i] == '-' && s[i + 1] == 'o' && s[i + 2] == '-' && s[i + 3] == '-' { o = true; } if s[i] == '-' && s[i + 1] == '-' && s[i + 2] == 'o' && s[i + 3] == '-' { o = true; } } } } if o { writeln!(out, "O").ok(); } else { writeln!(out, "X").ok(); } } stdout().write_all(&out).unwrap(); }