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:
#!/usr/bin/env python

import os, sys, math

def getPrimes(m, n):
  sqrtn = int(math.sqrt(n))
  isPrime = [True for i in range(sqrtn+1)]
  isPrime[0]=isPrime[1]=False

  isPrime2 = [True for i in range(n-m+1)]
  p=2
  mylist = []
  while True:
    if p==sqrtn+1:
      break
    if not isPrime[p]:
      p+=1
      continue
    
    i = p*p
    while True:
      if i > n:
        break
      if i > sqrtn and i < m: #increase i to multiple of p that is closest to and greater than m
        i = m if m%p==0 else m + (p-m%p);
        continue
      if i <= sqrtn:
        isPrime[i]=False
      if i >= m:
        isPrime2[i-m]=False
      i += p
    p += 1
  
  for i in range(n-m+1):
    if isPrime2[i]:
      if m+i !=0 and m+i != 1:
        print m+i

f = sys.stdin
t = int(f.readline())
for i in range(t):
  m,n = [int(x) for x in f.readline().strip('\r\n').split(' ')]
  getPrimes(m,n)
  print ''