X=['ABDCC','AAFCC','ACADE'] def f(x): X=[0]*8 c=0 while x: X[x&7]+=1 x>>=3 c+=1 if X[0]==0 and len(set(X[1:8]))==1: return 1 return 0 for t in range(int(input())): N=int(input()) A='' if N%3==1: A='12' elif N%3==2: A='252' else: A='' A+='5252'*(N//3) if len(A)%7: print(-1) continue x=len(A) S='' while x>=28: x-=28 S+='ACCACCCCCCCCABACAAFFE' T='' while x: T+=X[x//7-1] x-=7 S=T+S print(S)