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