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,sys
def rwh_primes2(n):
    correction = (n%6>1)
    n = {0:n,1:n-1,2:n+4,3:n+3,4:n+2,5:n+1}[n%6]
    sieve = [True] * (n/3)
    sieve[0] = False
    for i in xrange(int(n**0.5)/3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      ((k*k)/3)      ::2*k]=[False]*((n/6-(k*k)/6-1)/k+1)
        sieve[(k*k+4*k-2*k*(i&1))/3::2*k]=[False]*((n/6-(k*k+4*k-2*k*(i&1))/6-1)/k+1)
    return [2,3] + [3*i+1|1 for i in xrange(1,n/3-correction) if sieve[i]]
def main():
	T=input()
	primes=rwh_primes2(32000)
	#print primes
	cn=0
	numprime=len(primes)
	for cs in sys.stdin:
		m,n = map(int,cs.strip().split())
		if m<2:m=2
		isprime=[True]*(n-m+1)
		for i in xrange(numprime):
			p=primes[i]
			start=0
			if p>=m:start=p*2
			else:start=m+(p-m%p)%p
			falseblock = [False] * len(isprime[start-m:n+1-m:primes[i]]);
			isprime[start-m:n+1-m:primes[i]] = falseblock
		s=""
		for i in xrange(m,n+1):
			if (isprime[i-m]):
				s += str(i) + "\n"
		print s[:-1]
main()