#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5000;
int n, m, T, a[N];
int main() {
  for (cin >> T; T--;) {
    cin >> n;
    if (n == 1) {
      cout << -1;
    }
    for (int i = 1; i <= n; i++)
      if ((i * 3 + (n - i) * 2) % 3 != 0) {
        for (int j = 1; j <= n - i; j++) printf("2");
        for (int j = 1; j <= i; j++) printf("3");
        break;
      }
    printf("\n");
  }
}
