Problem: Shridhar wants to generate some prime numbers for his cryptosystem. Help him!
Your task is to generate all prime numbers between two given numbers.


Input

The first line contains t, the number of test cases (less then or equal to 10). 

Followed by t lines which contain two numbers m and n (1 ≤ m ≤ n ≤ 1000000000, n-m ≤ 100000) separated by a space.


Output
For every test case print all prime numbers p such that m ≤ p ≤ n,
one number per line.  Separate the answers for each test case by an empty line.

Example
Input:
2
1 10
3 5

Output:
2
3
5
7

3
5

Warning: large Input/Output data, be careful with certain languages (though most should be OK if the algorithm is well designed)

Solution (in PYTHON):

Solution:
from math import sqrt
#from time import time
#n=input()

a=list(xrange(0,32000+1))
for i in range(len(a)):
    a[i]=1
a[0]=0
a[1]=0
b=[]
for i in range(2,int(sqrt(32000+1))+1):
    if a[i]:
        for j in range(i*i,32000+1,i):
            a[j]=0
'''
for i in range(2,32000+1):
    if a[i]:
        b.append(i)
      
#print len(b)
#print b
def isprime(n):
    for i in b:
        if n%i==0:
            print 'here'
            return False
    return True
    
def count(di,r):
    sq=int(sqrt(r))
    #print di
    for i in range(2,sq+1):
        if a[i]==1:
           ans= 
           for j in xrange(i*i,r+1,i):
            di[j]=0
    #print di
    return di
    
    
    
    
'''    
test=input()
while test:
    test-=1
    l,r=map(int,raw_input().split())
    #t1=time()
    #print l,r
    t=dict.fromkeys(xrange(r-l+1),1)
    sq=int(sqrt(r))
    for i in range(2,sq+1):
        if a[i]==1:
            temp=l/i
            ans=temp*i
            for j in range(ans,r+1,i):
                if j-l>=0 and j!=i:
                    t[j-l]=0
    #print time()-t1

    for i in range(r-l+1):
        if t[i]==1 and i+l!=1:
            print i+l
    print