#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int main() {
int T; scanf("%d", &T);
while (T--) {
int n; scanf("%d", &n);
if (n < 15) puts("-1");
else printf("%d\n", n - 7);
}
return 0;
}


05-13
1392

01-24
54

05-21