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:
import math

def sieve(n):
    a = [True for i in xrange(n+1)]
    a[0] = False
    a[1] = False

    m = int(math.sqrt(n)) + 1

    for i in xrange(2, m+1):
        if a[i]:
            for j in xrange(i*i, n+1, i):
                a[j] = False
    return a

def getprimes(start, end, primes):
    a = [True] * (end - start + 1)
    if start == 1:
        a[0] = False

    for p in primes:
        begin = start/p
        if begin == 0:
            begin = p
        else:
            begin *= p
        for i in xrange(begin, end+1, p):
            if i >= start and i != p:
                a[i - start] = False

    return [start+i for i, j in enumerate(a) if j]


if __name__=="__main__":
    maxi = 0
    l = []
    n = int(raw_input())
    for i in xrange(n):
        m, n = [int(i) for i in raw_input().split()]
        l.append((m, n))
        if maxi < n:
            maxi = n

    primelist = sieve(int(math.sqrt(maxi)) + 1)
    primes = [i for i, j in enumerate(primelist) if j]
    for i,j in l:
        r = getprimes(i, j, primes)
        for k in r:
            print k
        print ""