#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) { return; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
void solve() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << -1 << endl;
    return;
  }
  vector<long long> a(n, 0);
  a[n - 1] = 7;
  for (long long i = n - 2; i >= 1; --i) {
    a[i] = 7;
  }
  a[0] = 4;
  for (long long i = 0; i < n; ++i) {
    cout << a[i];
  }
  cout << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  auto start = chrono::high_resolution_clock::now();
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  auto end = chrono::high_resolution_clock::now();
  cerr << " Execution time : "
       << chrono::duration_cast<chrono::milliseconds>(end - start).count()
       << "ms" << endl;
  return 0;
}
