X=['ABDCC','AAFCC','ACADE'] 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: S+=X[(x%21)//7-1] x-=7 print(S)