import sys cand = ['--o-', '-o--', '-oo', 'oo-', 'ooo'] i = 1 while i < 2000: cand.append('o' + '-' * i + 'o') i = i * 2 + 1 for c in cand: print(cand) t = int(sys.stdin.readline().rstrip()) def main(): for _ in range(t): n, s = sys.stdin.readline().split() for c in cand: if s.find(c) != -1: print('O') break else: print('X') if __name__ == '__main__': main()