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:
# cook your code here
import math
#MAX_NUM = int(math.sqrt(100))+1
MAX_NUM = 31623 #int(math.sqrt(1000000000))+1

def get_primes(n):
    if n<2:
        return []
    sqrt_limit = int(math.sqrt(n))+1
    l = [True]*(n+1)
    l[0], l[1] = False, False
    for p in xrange(2, sqrt_limit):
        if l[p]:
            for x in xrange(p*2, n+1, p):
                l[x] = False
    a = []
    for i in xrange(len(l)):
        if l[i]: 
            a.append(i)
    return a

primes = get_primes(MAX_NUM)
#print primes

for casenum in range(input()):
    m, n = map(int, raw_input().split())
    m = max(2, m)
    sqrt_limit = int(math.sqrt(n))+1
    l = [True]*(n-m+1)
    for p in filter(lambda x:x<sqrt_limit, primes):
        i=max(m/p*p, p)
        if i < m or i == p: 
            i += p 
        for x in xrange(i-m, n-m+1, p):
            l[x] = False
    for i in xrange(len(l)):
        if l[i]: print i+m
    print ''