#include #include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template vector> vec2d(int n, int m, T v){ return vector>(n, vector(m, v)); } template vector>> vec3d(int n, int m, int k, T v){ return vector>>(n, vector>(m, vector(k, v))); } template void print_vector(vector v, char delimiter=' '){ if(v.empty()) { cout << endl; return; } for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter; cout << v.back() << endl; } string as_base_8(int n){ string ans; while(n){ ans += (n%8)+'0'; n /= 8; } reverse(ans.begin(), ans.end()); return ans; } string as_base_16(int n){ string ans; while(n){ int r = n%16; if(r <= 9) ans += r+'0'; else ans += (r-10)+'A'; n /= 16; } reverse(ans.begin(), ans.end()); return ans; } string base8_to_base16(string s){ int x = 0; for(char c: s){ x = x*8+(c-'0'); } cout << s << ' ' << x << ' ' << as_base_16(x) << endl; return as_base_16(x); } map mp; void test(){ for(int x = 0; x < 16*16*16; x++) { auto b8 = as_base_8(x); auto b16 = as_base_16(x); bool ok = true; for(char c: b16){ if(isdigit(c)) ok = false; } if(ok){ mp[b16] = b8; } } } int calc_len(int i){ int len = (i/3)*4; if(i%3 == 1) len += 2; if(i%3 == 2) len += 3; return len; } void f(){ string s = "1234567"; do{ auto t = base8_to_base16(s); bool ok = true; for(char c: t){ if(isdigit(c)) ok = false; } if(ok){ cout << t << endl; break; } }while(next_permutation(s.begin(), s.end())); } string s7 = "ABDCC"; string s14 = "BBCCCFACAC"; string s28 = "ACCACCCCCCCCABACAAFFE"; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int t; cin >> t; while(t--){ int n; cin >> n; int len = calc_len(n); if(len%7 != 0 || len%28 == 21){ cout << -1 << endl; continue; } string ans; if(len%28 == 7) ans += s7; if(len%28 == 14) ans += s14; for(int i = 0; i < len/28; i++) ans += s28; cout << ans << endl; } }