fn solve() -> String { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec<&str> = temp.trim().split_whitespace().collect(); let n = temp[0].parse::().unwrap(); let s = temp[1]; if s.contains("ooo") || s.contains("-oo") || s.contains("oo-") || s.contains("o-o-o") { return "O".to_string(); } return "X".to_string(); } fn main() { let mut t = String::new(); std::io::stdin().read_line(&mut t).ok(); let t: usize = t.trim().parse().unwrap(); let mut result = Vec::with_capacity(t); for _ in 0..t { result.push(solve()); } for v in result.iter() { println!("{}", v); } }