#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
int t;
cin>>t;
for(int i = 0; i < t; i++){
int n;
cin>>n;
if(n == 1){
cout<<-1<<endl;
}
else{
string res = "";
if(n % 3 == 1){
for(int j = 0; j < n - 2; j++){
res += '2';
}
res += "33";
}
else{
for(int j = 0; j < n - 1; j++){
res += '2';
}
res += '3';
}
cout<<res<<endl;
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCgogCmludCBtYWluKCkKewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBpbnQgdDsKICAgIGNpbj4+dDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCB0OyBpKyspewogICAgICAgIGludCBuOwogICAgICAgIGNpbj4+bjsKICAgICAgICBpZihuID09IDEpewogICAgICAgICAgICBjb3V0PDwtMTw8ZW5kbDsKICAgICAgICB9CiAgICAgICAgZWxzZXsKICAgICAgICAgICAgc3RyaW5nIHJlcyA9ICIiOwogICAgICAgICAgICBpZihuICUgMyA9PSAxKXsKICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGZvcihpbnQgaiA9IDA7IGogPCBuIC0gMjsgaisrKXsKICAgICAgICAgICAgICAgICAgICByZXMgKz0gJzInOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmVzICs9ICIzMyI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZXsKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgZm9yKGludCBqID0gMDsgaiA8IG4gLSAxOyBqKyspewogICAgICAgICAgICAgICAgICAgIHJlcyArPSAnMic7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXMgKz0gJzMnOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGNvdXQ8PHJlczw8ZW5kbDsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQ==