s=["o-o","-oo","oo-","-o--","--o-","o-o-o","ooo","o---o"] for _ in range(int(input())): a,b=input().split();ans="X" c=0;d=1 while d