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 sys import stdin
from itertools import imap

def main():
	# limit = int(sqrt(2147483647)) + 1
	limit = 32000
	prime = [True]*limit
	for i in xrange(3, int(sqrt(limit)) + 1, 2):
		if prime[i]:
			prime[i*i: : 2*i] = [False]*len(xrange(i*i, limit, 2*i))
	primes = [i for i in xrange(3, limit, 2) if prime[i]]

	data = imap(int, stdin.read().split())
	out = []
	for _ in xrange(data.next()):
		m, n = data.next(), data.next()
		if m == 1:
			m = 2
		lprime = [True]*(n - m + 1)
		cap = int(sqrt(n)) + 1
		for i in primes:
			if i > cap:
				break
			if i*i > m:
				bg = i*i - m
			else:
				bg = m + (i - m%i)%i
				if bg%2 == 0:
					bg += i
				bg -= m
			lprime[bg: : 2*i] = [False]*len(xrange(bg, n - m + 1, 2*i))
		if m <= 2 <= n:
			out.append('2')
		out.extend([str(i) for i in xrange(2*(m/2) + 1, n + 1, 2) if lprime[i - m]])
	print '\n'.join(out)

main()