#include <iostream>
using namespace std;
int main(){
int t,n; cin >> t;
while(t--){
cin >> n;
if(n == 1 || n == 3) cout << "-1\n";
else if(n%2 == 0){
for(int i = 0; i<n-2; i++) cout << "3";
cout << "66\n";
}else{
for(int i = 0; i<n-5; i++) cout << "3";
cout << "36366\n";
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKXsKCWludCB0LG47CWNpbiA+PiB0OwoJd2hpbGUodC0tKXsKCQljaW4gPj4gbjsKCQlpZihuID09IDEgfHwgbiA9PSAzKQljb3V0IDw8ICItMVxuIjsKCQllbHNlIGlmKG4lMiA9PSAwKXsKCQkJZm9yKGludCBpID0gMDsgaTxuLTI7IGkrKykJY291dCA8PCAiMyI7CgkJCWNvdXQgPDwgIjY2XG4iOwoJCX1lbHNlewoJCQlmb3IoaW50IGkgPSAwOyBpPG4tNTsgaSsrKQljb3V0IDw8ICIzIjsKCQkJY291dCA8PCAiMzYzNjZcbiI7CgkJfQoJfQoJcmV0dXJuIDA7Cn0=