#include<iostream> #include<stdio.h> #include<stdlib.h> using namespace std; int main(){ int t; int x; cin>>t; while(t--){ cin>>x; int temp; temp = x-7; if(temp<=7){ printf("-1\n"); } else{ printf("%d\n",temp); } } }