Problem: Today, teacher taught Xenny the chapter 'Prime numbers and Composite numbers'. Xenny liked it and being a studious boy, wanted some homework. So teacher gave him a simple task. The task is to find the smallest composite number greater than given no. Xenny was happy to get the simple task. But Xenny didn't get the time for complting the homework being busy in helping his mother throughout the day. You, a best friend of Xenny, don't want Xenny to get punished by teacher. So its your job to complete his homework.
Formally, there will be t numbers and you have to find smallest greater composite number for each of them.

Input:

The first line of input will be t i.e. number of test-cases.
Followed by t lines each containing n.

Output:

For each test-case, Print the smallest greater number than n which is a composite number on new line.

Constraints:

SMALL:

1 ≤ t ≤ 10

0 ≤ n ≤ 10

MEDIUM:

1 ≤ t ≤ 500

0 ≤ n ≤ 1000

LARGE:

1 ≤ t ≤ 50000

0 ≤ n ≤ 100000

SAMPLE INPUT
2
3
8

SAMPLE OUTPUT
4
9

Explanation

Test-cases are 2.
For first case, the smallest composite no. greater than 3 is 4 .
For second case, the smallest composite no. greater than 8 is 9 .

Solution (in PYTHON):

Solution:
import math
primelist=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199]
skiplist=[1,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,179,191,193,197,199]

def isprime(p):
#    print p
    i=0
    temp=math.sqrt(p)
#    print temp
    while(primelist[i]<temp):
#        print primelist[i]
        if(p%primelist[i]==0):
            break
        else:
            i=i+1
    if(primelist[i]>temp):
#        primelist.append(p)
        return 1
    else:
        return 0


for i in range(1,3):
    for j in range(0,43):
        temp=210*i+skiplist[j]
        if(isprime(temp)):
            primelist.append(temp)
#            print temp

#print primelist
for z in range(int(raw_input())):
    n=int(raw_input())+1
    if n==2 or n==1:
        print "4"
    elif(isprime(n)):
        print n+1
    else:
        print n