#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    fill(a, a + n, 2);
    long long sum = (n - 1) * 2 + 3;
    a[n - 1] = 3;
    if (sum % 3 == 0) a[0]++;
    if (n == 1)
      cout << "-1" << endl;
    else {
      for (int i = 0; i < n; i++) cout << a[i];
      cout << endl;
    }
  }
  return 0;
}
