#include <iostream>
#include <string>
using namespace std;

string autentica(string S) {
    return "2137";
}

// NON TOCCARE SOTTO QUESTA LINEA

#ifndef EVAL
int main() {
    int T; cin >> T;
    for (int i = 0; i < T; i++) {
        string S; cin >> S;
        string ans = autentica(S);
        cout << (ans == "" ? "-" : ans) << '\n';
    }
}
#endif
