#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> s(n);
  for (int i = 0; i < (n); ++i) {
    cin >> s.at(i);
  }
  string ans;
  for (int k = 0; k < (n); ++k) {
    ans = "";
    if (s.at(k) == 1) {
      cout << -1 << endl;
    } else if (s.at(k) % 3 == 1) {
      for (int j = 0; j < (s.at(k) - 2); ++j) {
        ans += "2";
      }
      ans += "33";
      cout << ans << endl;
    } else {
      for (int l = 0; l < (s.at(k) - 1); ++l) {
        ans += "2";
      }
      ans += "3";
      cout << ans << endl;
    }
  }
}
