import sys input = sys.stdin.readline T=int(input()) Q=[list(input().split()[1]) for i in range(T)] for S in Q: N=len(S) flag=0 for i in range(N-2): if S[i]=="o" and S[i+1]=="o" and S[i+2]=="-": print("o") flag=1 break if flag: continue for i in range(N-3): if S[i]=="x" and S[i+1]=="o" and S[i+2]=="-" and S[i+3]=="-": S[i+2]="o" S[i+3]="x" for i in range(N-2): if S[i]=="-" and S[i+1]=="o" and S[i+2]=="o": print("o") flag=1 break if flag: continue for i in range(N-1,2,-1): if S[i]=="x" and S[i-1]=="o" and S[i-2]=="-" and S[i-3]=="-": S[i-2]="o" S[i-3]="x" for i in range(N-2): if S[i]=="o" and S[i+1]=="o" and S[i+2]=="o": print("o") break else: print("x")