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
sqrt_max = int(math.ceil(math.sqrt(1000000000))) + 1

primes = [True] * (sqrt_max)
primes[0] = False
primes[1] = False
def sieve():
    i = 2
    n = len(primes)
    while i*i <= n:
        if primes[i]:
            j = i*i
            while j < n:
                primes[j] = False
                j += i
        i += 1
        
    

n = int(raw_input())
for i in xrange(n):
    a, b = raw_input().split()
    a = int(a)
    b = int(b)
    sieve()
    if sqrt_max < b:
        another_sieve = [True] * (b-a+1)
        lets_start = a
        if a < sqrt_max:
            lets_start = sqrt_max
            another_sieve[0:lets_start-a] = primes[a:]
        for j, x in enumerate(primes):
            if primes[j]:
                min_in_another = int(math.ceil((float(lets_start)/j)) * j)
                min_in_another_index = min_in_another - a
                while min_in_another_index < len(another_sieve):
                    another_sieve[min_in_another_index] = False
                    min_in_another_index += j
    else:
        another_sieve = primes[a:b+1]
    for j, x in enumerate(another_sieve):
        if x:
            print (j+a)
    print ""