T=int(input()) for _ in range(T): N=int(input()) S=N*(N+1)//2 if S%2==1: print(-1);continue S//=2 ans=[0 for _ in range(N)] n=N while S: if n<=S: S-=n ans[n-1]=1 n-=1 print("".join(map(str,ans)))