#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n == 1) {
      cout << "-1\n";
      continue;
    } else {
      int s = 3;
      vector<int> v(n);
      v[0] = 3;
      for (int i = 1; i < n; i++) {
        if ((s + 2) % 3 == 0) {
          v[i] = 3;
          s += 3;
        } else {
          v[i] = 2;
          s += 2;
        }
      }
      for (int i = n - 1; i >= 0; i--) cout << v[i];
      cout << endl;
    }
  }
}
