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:
t=input()
def fx1(n):            #gives list of primes upto n,quite efficiently
 l = (range(3,n+1,2))
 d=[2]
 l1=set(l)
 for x in l:
  #print x
  if x in l1:d.append(x)
  t= set(range(x,n+x,x))
  l1.difference_update(t)  
 return d
d=fx1(32000)                  #no need to calulate prime list upto n2 again and again 
for ww in range(t):
	m,n=map(int,raw_input().split())
	if (m==1):m+=1
	#n2=int(n**.5)       #if a number btw m,n isn't divisible by any number below n2 then it is a prime
	#d=fx1(n2)
	#print n2,"=n2 " , d,"=d"
	l1=set(range(m-m%2+1,n+1,2))
	#print "l1 formed=",l1
	for x in d:
		s=set(range(m-m%x,n+1,x))
		l1.difference_update(s)
		if (x>n):break
		if (x>=m):l1.add(x)
		#print x,l1
		
	ansl=list(l1)
	ansl.sort()
	for x in ansl:print x