#include<stdio.h> int main() { int t,age,x; scanf("%d",&t); while(t--) { scanf("%d",&age); if(age<=14) printf("-1\n"); else printf("%d\n",age-7); } }