N = int(input()) for i in range(N): L,S = input().split() L = int(L) S = S + 'xxx' O = [0]*4 j = 0 while j0 or O[2]>0 or O[1]>=2: print('O') else: print('X')