Given a number N find out the minimum number M such that result of N modulo M become either 4 or 7.
First line of input contains number of test cases T. Each test case contains a single integer N.
Print the minimum value of M such that result of N%M become either 4 or 7 if there is no any value of M exists then print -1.
1 <= T <= 103
1 <= N <= 109
Test Case #1: For N=9, minimum value of M will be 5.